"This was created during my time as a student at Code Chrysalis."
This offers API of ToDoList and includes HTML which is Example of use.
Install dependencies.
yarn
Start service.
yarn start
If you need seed data, use this command.
yarn run knex --knexfile models/knexfile.js seed:run
Check
http://localhost:3000/todos/
Create todo.
request params
{
title: 'newtitle3',
description: 'newtitle888',
priority: 'low',
due_date: 2020-12-30T02:11:12.000Z,
}
response (created todo item)
{
id: 93,
title: 'newtitle3',
description: 'newtitle888',
priority: 'low',
due_date: 2020-12-30T02:11:12.000Z,
updated_at: 2020-01-26T01:03:20.000Z
}
Return todo list.
response (list of todo item)
[{
id: 93,
title: 'newtitle3',
description: 'newtitle888',
priority: 'low',
due_date: 2020-12-30T02:11:12.000Z,
updated_at: 2020-01-26T01:03:20.000Z
},
{....}
]
Return the todo-item with the given id.
response
{
id: 93,
title: 'newtitle3',
description: 'newtitle888',
priority: 'low',
due_date: 2020-12-30T02:11:12.000Z,
updated_at: 2020-01-26T01:03:20.000Z
}
Update todo-item
request params
{
title: 'newtitle3',
description: 'newtitle888',
priority: 'low',
due_date: 2020-12-30T02:11:12.000Z,
}
response (updated todo item)
{
id: 93,
title: 'newtitle3',
description: 'newtitle888',
priority: 'low',
due_date: 2020-12-30T02:11:12.000Z,
updated_at: 2020-01-26T01:03:20.000Z
}
Delete todo-item
response (result of operation)
"OK"
DB name: todoapp
TABLE name: todos
Table schema:
id :int(unique)
title :string
description :text
priority :enum (low, middle, high)
dueDate :date
updatedAt :date