Simple REST JSON backend to create todo lists containing todo items. Supports CORS.
Can be found at gofore-todo.herokuapp.com.
npm install
npm start
Returns a list of todo lists.
Creates a todo list with a name given as JSON object.
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]"}
]
}
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"
}
Deletes the todo list with id id
.
Returns the todo item with id 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]"}
Deletes the todo item with an id id
.