Api-Task
Descripton
This project consists of an API that changes the task status based on a predefined state machine that this task must respect. It allows the user to do the normal CRUD operations. The API have 4 main operations: Create Task, Get Task, Delete Task, Update Task
Run the app
python app.py
by Docker run :
$ docker build --rm -t flaskapi:latest .
docker run --rm -d -p 5000:5000 flaskapi:latest
and : http://localhost:5000
and on your browser : REST API
POST
Create Request http://127.0.0.1:5000/tasks
request body raw
{"status":"draft","title":"task_name"}
response
{"id": 3,"status": "draft","title": "task_name"}
GET
Get Request http://127.0.0.1:5000/tasks/3
response
{"id": 3,"status": "draft","title": "task_name"}
DELETE
Delete Request http://127.0.0.1:5000/tasks/3
response
204 NO CONTENT
PUT
Update Request http://127.0.0.1:5000/tasks/1/archived
response
{"id": 1, "status": "archived", "title": "task2"}
GET
Get All Tasks http://127.0.0.1:5000/tasks
response
[{"id": 1, "status": "archived", "title": "task2"}, {"id": 2,"status": "draft", "title": "task1"}]