Simple REST API for database of kicker (foosball) games
- Install Go;
- (Optional) Run docker container for mysql database with
docker-compose up
; - Set database credentials for your environment in
dbconfig.yaml
; - Install sql-migrate tool:
go get github.com/rubenv/sql-migrate/...
- Run migrations on database (for production use
-env=production
flag):
sql-migrate up
- Build with
go build
in kicker-api directory.
kicker-api [--port value] [--datasource value] [--dialect value]
Where --port
is webserver port (4000 by default), --datasource
is database connection string (by default DSN from dbconfig.yaml is used), --dialect
is database dialect ("mysql" by default, can be any dialect supported by sqlx).
KICKER_ENV
environment variable is used for choosing database config from dbconfig.yaml ("development" by default).