Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

rameezk/todo-api-flask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

todo-api-flask

A RESTful API for managing a todo list. Written in Flask and Python

Running

Locally (Development Mode)

python app.py

Production

./run.sh

Environment Variables

You'll need the following environment variables to be defined

  • MONGODB_HOST (MongoDB host)
  • MONGODB_PORT (MongoDB port)

Endpoints

Health

Checks to see if the API is alive and can connect to mongo

curl --request GET \
  --url http://localhost:5000/health

List all tasks

Gets all the tasks

curl --request GET \
  --url http://localhost:5000/todo/api/tasks

List task with specific task ID

Lists a task with given task ID

curl --request GET \
  --url http://localhost:5000/todo/api/tasks/1

Create a task

Create a task

curl --request POST \
  --url http://localhost:5000/todo/api/tasks \
  --header 'content-type: application/json' \
  --data '{ \
	"title": "Buy Milk", \
	"description": "Buy some milk" \
  }'

Update task with specific task ID

Update a task with given task ID

curl --request PUT \
  --url http://localhost:5000/todo/api/tasks/1 \
  --header 'content-type: application/json' \
  --data '{ \
	"title": "Bleh", \
	"description": "Bleh bleh bleh", \
	"done": true \
}'

Delete Task

Delete a task with a given ID

curl --request DELETE \
  --url http://localhost:5000/todo/api/tasks/1

About

A RESTful todo list API written in Flask and Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published