Built with (but not limited to) :
- connexion
- Flask
- flask-marshmallow
- marshmallow-sqlalchemy
- flask_jwt_extended
- Flask-SQLAlchemy
- tornado
git clone https://github.com/muhammadh-s/order-pizza-api
cd order-pizza-api
pip install -r requirements.txt
or place virtual environment and then installpython server.py
Example Response
curl -s https://order-pizza-api.herokuapp.com/api/orders
[
{
"Crust": "NORMAL",
"Flavor": "BEEF-NORMAL",
"Order_ID": 1,
"Size": "M",
"Table_No": 1,
"Timestamp": "2018-12-12T13:42:13.704148+00:00"
},
{
"Crust": "THIN",
"Flavor": "CHEESE",
"Order_ID": 2,
"Size": "S",
"Table_No": 5,
"Timestamp": "2018-12-12T13:42:13.704148+00:00"
},
{
"Crust": "NORMAL",
"Flavor": "CHICKEN-FAJITA",
"Order_ID": 3,
"Size": "L",
"Table_No": 3,
"Timestamp": "2018-12-12T13:42:13.720690+00:00"
}
]
Endpoints
- POST :
/auth
curl -X POST -H "Content-Type: application/json" -d '{"username": "test", "password": "test"}' https://order-pizza-api.herokuapp.com/api/auth
- POST :
/orders
(Access Token is required)
curl
-H "Content-Type: application/json"
-H "Authorization: Bearer <JWT>"
-X POST
-d
'{
"Flavor": "ABC",
"Crust": "XYZ",
"Size": "XL",
"Table_No": 9
}'
https://order-pizza-api.herokuapp.com/api/orders
Do replace the <JWT> in the above request with the token you have acquired.
- DELETE :
/orders/{Order_ID}
curl -X DELETE https://order-pizza-api.herokuapp.com/api/orders/1
MIT