In 2022, I took a front-end test to work at Warren. The API used in the test was hosted on Heroku, but it's currently offline. To continue consuming my front-end code, I decided to create my own API using Go and Fiber. You can find the front-end code for the project at https://github.com/johanguse/warren-desafio-web.
I'm happy to say that I passed the test and worked at the company for some time.
- Go 1.21 or later
- MySQL 5.7 or later
- Clone the repository:
git clone https://github.com/johanguse/api-go-lang-transations.git- Install the dependencies:
cd transactions-api
go mod download- Set up the database:
mysql -u root -p < database/sql/database.sql- Start the server:
go run main.goThe server will start on http://127.0.0.1:8000/api/.
You can use the healthcheck to verify the status.
https://api-go-lang-transations.fly.dev/api/swagger/index.html
Base URL
http://127.0.0.1:8000/apiGET /healthcheckerYou can use the healthcheck to verify the status and proper functioning of your application. It returns a status of success and a welcome message.
"status": "success",
"message": "Welcome to Golang, Fiber, and GORM",GET /transactionsList transactions with pagination.
POST /transactionsCreate a new transaction.
GET /transactions/:idFind a transaction by its unique ID.
PUT /transactions/:idUpdate a transaction by its unique ID.
DELETE /transactions/:idDelete a transaction by its unique ID.
This project is licensed under the MIT License - see the LICENSE file for details.