Skip to content

Latest commit

 

History

History

todolist-http-finch

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

TodoList HTTP service using finch

TodoList http service implementation using finch and todolist-lib.

Running the Application

sbt todolist-http-finch/run

By default, it'll bootstrap in port 8081.

Playing with the App

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"