A simple REST API service serving the capitals and areas of countries.
The API service can be utilized by following the protocol
/api/v1/countries
/api/v1/countries/<index_no>
/api/v1/countries/<index_no>/capital
/api/v1/countries/<index_no>/area
For example:
/api/v1/echo/countries/20/area
Using pip, install the required dependencies from ~/requirements.txt
pip install -r requirements.txt
- Export the required environment variables. (Here we are exposing port 9532)
export FLASK_APP=restapi/app
export FLASK_RUN_PORT=9532
- Start the flask application from the root of the repository
flask run
-
Start the application by following the above mentioned procedure.
-
Run the integration tests using the command (from the root of the repository)
python3 -m pytest tests/api_integration_test.py