This is an api for trainers
docker-compose start db
docker-compose run -v $PWD/schema.sql:/schema.sql db psql -h db -U postgres -a -q -f schema.sql
docker-compose up
Get a trainer by id
curl http://localhost:8080/trainers/1
Create a new trainer
curl -H "Content-Type: application/json" \
-d '{"email":"[email protected]","phone":"11111111111","first_name":"foo","last_name":"bar"}' \
http://localhost:8080/trainers
The project uses standard go test
for testing. Seed data is loaded from the testdata/seeds.sql
file.
docker-compose run web go test
- Add more tests
- Database migrations
- Refactor separation of concerns
- Multi-stage Dockerfile for production container
- Log aggregation
- Status endpoint for healthchecks
- Monitoring
- Error reporting