Skip to content

Simple REST JSON todo backend with CORS support.

Notifications You must be signed in to change notification settings

gofore/todo-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo backend

Description

Simple REST JSON backend to create todo lists containing todo items. Supports CORS.

Can be found at gofore-todo.herokuapp.com.

How to use

npm install
npm start

API

Todo lists

GET todo-lists

Returns a list of todo lists.

POST todo-lists

Creates a todo list with a name given as JSON object.

GET todo-lists/:id

Returns an object containing the todo list name and a list of todo items for todo list with id id.

{
  "name": "My list",
  "todos": [
    {"id": 1, "name": "Do the laundry", "done": "false", "assignee": "[email protected]"},
    {"id": 2, "name": "Wash the dishes", "done": "true", "assignee": "[email protected]"}
  ]
}

POST todo-lists/:id

Adds a todo item with a name given as a JSON object to a list with id id.

{
  "name": "Do something"
}

Returns 200 on success with JSON object containing link to newly created todo item as value for key url:

{
  "url": "http://gofore-todo.herokuapp.com/todos/1"
}

DELETE todo-lists/:id

Deletes the todo list with id id.

Todo items

GET todos/:id

Returns the todo item with id id.

PUT todos/:id

Updates the todo item with id id. Takes an object with a name, done status and assignee as a JSON payload.

{"name": "Do the laundry", "done": "true", "assignee": "[email protected]"}

DELETE todos/:id

Deletes the todo item with an id id.

About

Simple REST JSON todo backend with CORS support.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •