This API is set up for use with Python >= 3.7 and Docker. You can set-up your local environment manually or compose up with docker to launch a containerised version of the API.
To run the server, you'll need to install a few requirements. To do this, run:
pip install -r requirements/common.txtThis will install only the dependencies required to run the server. To boot up the server, you can run:
bash bin/run.shThis will start a Gunicorn server that wraps the Flask app defined in api/app.py.
You should now be able to send:
curl localhost:8080/healthAnd receive the response OK and status code 200.
Unsurprisingly, you'll need Docker installed to run this project with Docker. To launch a containerised version of the API, run:
docker compose up -dYour server will boot up in a detached state as indicated by -d, and should be accessible as before. When you are ready to bring down your server, run:
docker compose downTesting the API is set up using pytest. To execute tests you can install the project's development dependencies with:
pip install -r requirements/develop.txtThen from the root directory, run:
pytestThis runs tests/test_api.py which contains test functions.