Enter command for starting server.
$ deno task dev
or
$ deno run --allow-net app.ts
CRUD
with the curl command.
localhost:8080
It returns with Hello TodoApp with deno!
localhost:8080/todos/
{
status: 200,
data: []
}
$ curl -X POST -H 'Content-Type: application/json' -d '{"title": "TodoApp with deno", "content": "first posting"}' 'localhost:8080/todos/'
$ curl -X GET 'localhost:8080/todos/'
or
ID can be specified.
$ curl -X GET 'localhost:8080/todos/{:id}/'
Only isDone
can be updated. (false -> true)
$ curl -X PATCH 'localhost:8080/todos/{:id}/'
$ curl -X DELETE 'localhost:8080/todos/{:id}/'
$ deno cache --lock=lock.json --lock-write ./deps.ts
$ deno cache --reload --lock=lock.json ./deps.ts