This is a restful api with a single endpoint to search an Artist top 10 hits.
If you want to only run the project using docker you can skip this section to docker.
For the next steps you need:
-
It is recommended to create a virtual enviroment first.
python -m venv .venv
-
Activate the virtual enviroment
source .venv/bin/activate # Linux source .venv/Scripts/activate # Windows
-
Install the dependencies
pip install -r requirements.txt
-
Set up all the required environment variables as in the .env.example file
-
Make sure you have your aws credentials set up aswell
export FLASK_ENV=development # enable hot reload
flask run
After the command you should see something like
* Debug mode: on
* Running on http://127.0.0.1:5000/
Example request: http://127.0.0.1:5000/artist/search?name=Kendrick%20Lamar&cache=False
This application has unit tests and integration tests.
-
Unit test
python -m unittest discover
-
Integration test
behave
PS: The integration test still using the same Dynamo table as the application
For the next steps you need:
-
Running
docker-compose up -d
-
You should be able to access the application on PORT=8000
Example request: http://0.0.0.0:8000/artist/search?name=Kendrick Lamar&cache=False