A sample project to demonstrate how to use finagle-http in communicating with external services. This application is a REST API that communicates with an external service called nytimes
- Java 11
- SBT
- Docker
- Docker Compose
-
Start a Redis server
$ docker-compose up -d
-
Check the
env.example
file for the required environment variables and make sure they are set -
Start the API server
sbt run
-
Run the tests
sbt test
The application has 2 endpoints, the health endpoint and the fetch books endpoint
Method | Endpoint | Description |
---|---|---|
GET | //me/books/list?author={author}&year={TheYearThatBookWasPublished} |
Fetches books based on author and year of publication |
GET | /health |
Health endpoint to check the status of the application |
NB: The year
query parameter is optional, and it can be a single year or comma separated years