$ git clone https://github.com/yodreik/api.git && cd ./api2/ Set up your config files. Use ./config/example.yml as a template
$ echo CONFIG_PATH=./config/local.yaml > .env
$ cat .env
CONFIG_PATH=./config/local.yamlImportant
Make sure, you have installed: swaggo/swag for rebuilding swagger documentation
$ make all
...
... swagger building logs
... tests results and coverage report
...Inside docker compose
$ docker build -t dreik-api:latest .
$ docker compose upor outside the docker
$ docker compose -f ./docker-compose.dev.yaml up -d
$ go build -o bin/api cmd/api/main.goNote
For local and dev environments, there are available coverage report (on /coverage endpoint) and SwaggerUI (on /docs/index.html). For production environment, this routes are not configured, like CORS headers.
$ go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest$ migrate -path migrations -database "postgres://postgres:password@localhost:5432/postgres?sslmode=disable" up$ curl -i http://localhost:6969/api/healthcheck
HTTP/1.1 200 OK
...$ docker exec -it dreik-api:latest psql -U usernameThan you can use SQL queries
select * from users;$ migrate -path migrations -database "postgres://postgres:password@localhost:5432/postgres?sslmode=disable" down