A simple Flask API to accept and fetch Pizza orders
Install this project with Github
git clone https://github.com/adithyapaib/Flask
cd Flask
pip3 install -r requirements.txt
sudo apt-get update && apt-get install -y rabbitmq-server
python3 app.py
GET /welcome
Returns a welcome JSON Message
POST /order
Parameter | Type | Description |
---|---|---|
order |
Array |
Required. The JSON body with Pizza orders |
{"order": ["Pizza1", "Pizza2"]}
GET /getorders
Returns a JSON with all the Pizza Orders
GET /getorders/<order_id>
Returns Order details of a given order id , 404 Not found if record not present.
Make sure MongoDB is running locally or else the user can also run a MongoDB Docker container using the following command for the application to run.
docker run -d -p 27017:27017 --name mongo mongo:latest
The project can be tested using with the follwing command.
python3 -m pytest
- Dockerize the application and deploy it to Dockerhub
- Write dockercompose.yml file to combine mongo and flask app deployment