Backend for React series
git clone
npm install
node index.js
Method: GET
endpoint: /
Returns array[objects]
[
{
"id": "9a1f82ab-7670-449f-b136-1833600bbd5b",
"title": "Buy milk",
"done": false
},
{
"id": "adec299a-a0a1-4ddc-acf6-b9aa4c4f9f1c",
"title": "Like SocialNerds on YouTube",
"done": false
}
]
Method: POST
endpoint: /
Headers
Content-type: application/json
Body
{
title: Todo title,
done: false
}
Returns object
{
"id": "e120050b-4193-4d98-8a58-2081115f92eb",
"title": "Buy milk",
"done": false
}
Method: PATCH
endpoint: /:id
Headers
Content-type: application/json
Returns object
{
"id": "e120050b-4193-4d98-8a58-2081115f92eb",
"title": "Buy milk",
"done": true
}
Method: DELETE
endpoint: /:id
Headers
Content-type: application/json
Returns boolean
true|false
Method: GET
endpoint: /clear
Returns array[objects]
[
{
"id": "9a1f82ab-7670-449f-b136-1833600bbd5b",
"title": "Buy milk",
"done": false
},
{
"id": "adec299a-a0a1-4ddc-acf6-b9aa4c4f9f1c",
"title": "Buy milk",
"done": false
}
]