Built api with Flask
Before submitting your assessment, make sure you have:
❏ An /api/posts route that handles the following query parameters:
❏ tags (mandatory) : any number of comma-separated strings
❏ sortBy (optional) : one of “id”, “reads”, “likes”, “popularity”
❏ direction (optional) : one of “asc”, “desc”, defaults to “asc”
❏ Error handling: Return an error message if:
❏ tags parameter is missing
❏ sortBy or direction has an invalid value
❏ Testing without using our solution API route
❏ Caching (bonus)
./startup.sh test
or
bash startup.sh test
Just need one instruction
pip install -r requirements.txt
or if pip not added to path system
python -m pip install -r requirements.txt
flask run
or
python -m flask run
or
./startup.sh start
or
bash startup.sh test
http://127.0.0.1:5000/api/posts?tags=tech,history,startups&sortBy=reads