This project involves fetching and processing data from the REST Countries API. The project has two main objectives:
- Create a sorted list of countries by population density in descending order.
- Identify the Asian country with the most neighboring countries from a different region.
- Docker version 24.0.5, build ced0996
To run the application use Docker:
- Pull the Docker image:
docker pull kristofs577/countries-image:latest
- Once it's pulled, list the images using the docker images command, and save the Image ID:
IMAGE_ID=$(docker images --format "{{.ID}}" kristofs577/countries-image:latest | head -n 1)
- Run the Docker container:
docker run -p 8080:8080 -e "SPRING_PROFILES_ACTIVE=prod" $IMAGE_ID
To explore the API endpoints interactively, you can visit the Swagger UI after running the application.
This handler manages global exceptions for the API.
Handles cases when data is not available.
Response:
- HTTP Status Code: 500
- Body: "Data not available."
Handles data processing exceptions.
Response:
- HTTP Status Code: 500
- Body: "An error occurred during data processing."