Project from course https://udemy.com/course/rest-api-flask-and-python/
- Python 3.10
- Pip
- Virtualenv (optional)
If you decide to run it in a virtual environment, perform the following steps within a virtual environment
pip3 install -r requirements.txt
Run the program
To run the program you need to go to the root directory and execute:
python3 app.py
POST - Register an user (example on body request: {"user": "pedro", "password": "myp4ssw0rd"})
/register
POST - Login to the API example: (example on body request: {"user": "pedro", "password": "myp4ssw0rd"})
/login
POST - You need to pass the JWT token on params (Bearer )
/logout
POST - refresh the session token (Bearer )
/refresh
GET - get user information
/user/<user_id>
DEL - delete specific user
/user/<user_id>
GET - get all stores
/stores
GET - get specific store
/store/<name>
POST - add store
/store/<name>
DEL - delete store
/store/<name>
GET - get all items, if you logged in you will get more information
/items
GET - get specific item
/item/<name>
POST - add new item to store (example on body: {"price": 10.24, "store_id": "1"})
/item/<name>
PUT - update the item in the store (example on body: {"price": 10.24, "store_id": "1"})
/item/<name>
DEL - delete specific item
/item/<name>