Provides REST API for CRUD operations on payment entities
Application expects configuration provided as environment variables, available vars:
PORT- app listen port, default8000MONGO_URL- URL to mongodb, requiredMONGO_DB_NAME, defaultpaymentsMONGO_COL_NAME, defaultpaymentsMONGO_TIMEOUT, default100msGIN_MODE, defaultdebug
The easies way to start the app is to follow steps:
docker-compose up -d; starts mongodb serverdep ensure; installs dependenciesMONGO_URL=mongodb://root:example@localhost:27017/admin go run main.go; starts app on port 8000
To stop mongo docker-compose stop
To stop and remove container (and remove data) docker-compose down
To run acceptance tests follow steps:
docker-compose up -d; starts mongodb serverdep ensure; installs dependenciesMONGO_URL=mongodb://root:example@localhost:27017/admin MONGO_DB_NAME=payments_test go test; runs tests usingpayments_testdatabase
API specification can be found in api/openapi.yml and viewed with https://editor.swagger.io/