Create a web application API using python called: “Bookjobs.” The application has three controllers:
- POST: create a new job.
- GET: list all jobs.
- DELETE: delete a job.
The app is app.py
under the /app
folder.
- Run the app
- Use postman to
GET
http://127.0.0.1:5000/bookjobs
- To get a specific ID, use
GET
http://127.0.0.1:5000/bookjobs/{id}
- To
DELETE
a specific ID, useDELETE
``http://127.0.0.1:5000/bookjobs/{id}`, and specify in the body the key-value pair to delete in json format.
- Use the curl_commands.sh file to issue REST API commands for GET/POST/DELETE.
- Run the container by binding the host port to the container exposed port:
docker run -p 80:5000 -it flask
. - Open another shell terminal and then issue the curl commands.
- The app will run on your browser at
localhost/bookjobs
URL.