It's a simple api, representing books library. Written in Go.
By default, http-server starts on http://localhost:8080.
API routes available by path /api/v1
Example: http://localhost:8080/api/v1/auth/login
- Install Docker
- Run
docker-compose up
- Install Go 1.22
- Install Postgres and create new database
- Run migrations :
cd migrations/scripts
goose postgres <connection_string> up
Example:
goose postgres postgres://postgres:12345@localhost:5432/books_library?sslmode=disable up
- By default, configs take from env variables. Env-config is here. Set variables in your system.
- If env-variables not set, config takes default values
- Run
go run ./cmd/app/main.go
- Run
go test ./... -coverprofile cover.out
- Generate test-coverage in html (need go cover installed)
go tool cover -html cover.out
- Go to swagger-editor
- Paste content of swagger.yaml in editor