A quick project i created while following Jose Salvatierra's excellent flask tutorial on Udemy. https://www.udemy.com/course/rest-api-flask-and-python/learn/lecture/6038434?start=0#overview
✨ Now updated with Flask 2.0 and Flask-Extended!! ✨
- update
SQLALCHEMY_DATABASE_URI
in app.py with db config name - SQL alchemy will create the database objects on app creation.
curl -X POST http://localhost:5000/register -H "Content-Type: application/json" -d '{"username": "luna", "password": "badgirl"}'
curl -X POST http://localhost:5000/user -H "Content-Type: application/json" -d '{"username": "luna", "password": "badgirl"}'
export JWT=$(curl -s -X POST http://localhost:5000/user -H "Content-Type: application/json" -d @creds.json | jq .access_token)
curl -X POST http://localhost:5000/store/xyz -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" -H "Accepts: application/json"
curl -X POST http://localhost:5000/item/apple -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" -H "Accepts: application/json" -d '{"store_id": 1, "price": "2.40"}'