TodoList http service implementation using finch
and todolist-lib
.
sbt todolist-http-finch/run
By default, it'll bootstrap in port 8081
.
There are several ways to interact with the TodoList
RESTful API.
Here some of examples:
- (Re-)Creating tables (H2 database):
curl -X "POST" "http://localhost:8081/reset"
- Inserting items:
curl -X "POST" "http://localhost:8081/insert" \
-H "Content-Type: application/json" \
-d $'{
"tag": {
"name": "Tag Name",
"id": 1
},
"items": [
{
"todoListId": 1,
"id": 1,
"item": "item 1",
"completed": false
}
],
"list": {
"title": "List title",
"tagId": 1,
"id": 1
}
}'
- Listing items:
curl "http://localhost:8081/list"