REST API exercise using Express
$ git clone https://github.com/egermano/express-exercise.git
$ yarn install
$ yarn start
(running on localhost:8080)
GET
/todos
expected response:
[
{
"title": "create a project",
"done": false
},
{
"title": "writes classes",
"done": false
},
{
"title": "create start script",
"done": false
}
]
POST
/todos
request body:
{
"title": "make some tests",
"done": false
}
expected response:
{
"title": "make some tests",
"done": false
}
PUT
/todos/3
request body:
{
"title": "make some tests",
"done": true
}
or partial
request body:
{
"done": true
}
expected response:
{
"title": "make some tests",
"done": true
}
DELETE
/todos/0
expected response:
[
{
"title": "writes classes",
"done": false
},
{
"title": "create start script",
"done": false
}
]