Boilerplate for Go based REST API with PostgreSQL, with live reload using CompileDaemon.
Builds a docker container for PostgreSQL Database. Builds a docker container with live reload for Go REST API and links to Postgres container
-
Create .env using .env.sample as example
-
Start docker containers
make
-
View logs
make logs
-
Visit
localhost:4000/
to check if API is responding -
Generate docs from swagger comments
make gen-docs
-
Visit
localhost:4000/docs
for documentation -
Stop docker containers
make down
Create new migrations
goose -dir db/migrations create <migration_name> sql
Run migrations
env $(cat .env) make migrate
Rollback migrations
env $(cat .env) make rollback
make gen-models
make test
MIT © 2020 Gerald Png