Jordanadopo / HachwaysBackendFlask

Build backend API with Flask

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hatchways test by Jordan ADOPO

Built api with Flask

Table of Contents

Checklist


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)

Running Test

./startup.sh test 

or

bash startup.sh test

Installing requiements

Just need one instruction

pip install -r requirements.txt

or if pip not added to path system

python -m pip install -r requirements.txt

Start API

flask run 

or

python -m flask run 

or

./startup.sh start 

or

bash startup.sh test

An example in browser with url:

http://127.0.0.1:5000/api/posts?tags=tech,history,startups&sortBy=reads

About

Build backend API with Flask


Languages

Language:Python 90.1%Language:Shell 9.9%