Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

TodoList HTTP service using http4s

TodoList http service implementation using http4s and todolist-lib.

Running the Application

sbt todolist-http-http4s/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"