Use docker compose to run the service.
docker compose up
curl --location --request GET 'http://localhost:5000/api/v1/books?title=A Treatise Concerning'
curl --location --request POST 'http://localhost:5000/api/v1/books/84/review' \ --header 'Content-Type: application/json' \ --data-raw '{ "bookId": 84, "rating": 5, "description": "Very good book" }'
curl --location --request GET 'http://localhost:5000/api/v1/books/84'
Run tests using pytest. The docker containers should be UP before you start running the tests. You also should export the following env variable in your current environment (outside the container).
- DATABASE_URL=postgresql://postgres:leotarla@localhost:5432/postgres
Now, run the tests:
pytest tests/
A high-level scalable architecture diagram can be found here.