This projects is a simple CRUD implementation of a server responsible for receiving payments from different banks.
GET /v1/payments - List payments
GET /v1/payments/some-id - Show a specific payment
POST /v1/payments - Create a new payment
PUT /v1/payments/some-id - Updates a specific payment
DELETE /v1/payments/some-id - Deletes a specific payment
As the project uses mongodb as database you can start it with:
docker-compose up
You might want to copy and modify .env.test
file to .env
at your convenience as the projects needs those env vars to start. Then you can load the variables with source .env
.
Then start the server with:
go run cmd/server.go
To run the tests you must have mongodb running and correctly configured the environment variables for the tests:
- Start mongodb:
docker-compose up
- Load env vars:
source .env.test
- Run tests:
go test ./...