Digital Publishing Books API
Install and run a mongoDB
- Using homebrew:
brew install mongodb- If not automatically started, use
brew services start mongodb - Stop mongoDB by running
brew services stop mongodb
- No further dependencies other than those defined in
go.mod
- Run application with
make debug - Run unit test with
make test
| Environment variable | Default | Description |
|---|---|---|
| BIND_ADDR | :8080 | The host and port to bind to |
| GRACEFUL_SHUTDOWN_TIMEOUT | 5s | The graceful shutdown timeout in seconds (time.Duration format) |
| HEALTHCHECK_INTERVAL | 30s | Time between self-healthchecks (time.Duration format) |
| HEALTHCHECK_CRITICAL_TIMEOUT | 90s | Time to wait until an unhealthy dependent propagates its state to make this app unhealthy (time.Duration format) |
| MONGODB_BIND_ADDR | localhost:27017 | The MongoDB bind address |
| MONGODB_BOOKS_COLLECTION | books | The MongoDB books collection |
| MONGODB_REVIEWS_COLLECTION | reviews | The MongoDB reviews collection |
| MONGODB_DATABASE | bookStore | MongoDB database |
| DEFAULT_MAXIMUM_LIMIT | 1000 | Pagination: maximum number of items returned |
| DEFAULT_LIMIT | 20 | Pagination: default number of items returned |
| DEFAULT_OFFSET | 0 | Pagination: default number of documents into the full list that a response starts at |
See ARCHITECTURE Source of truth for processing of book data for search.
See CONTRIBUTING for details.
Copyright © 2020 - 2021 Catalina Garcia
Released under MIT license, see LICENSE for details.