Project made with purpose of learning Haskell usage as server-side language.
REST API with basic CRUD actions on todo list
Download or clone master branch. In the root project directory run:
stack build --exec to-do-app-exe
Server will run on:
http://localhost:8080/
and you are ready to "hit" some endpoints.
Here are some curl examples:
- Get the whole todo list:
curl --location --request GET 'http://localhost:8080/todos'
- Add a new item to the list:
curl --location --request POST 'http://localhost:8080/todos' \
--header 'Content-Type: application/json' \
--data-raw '{
"dueBy": "2010/10/21 12:00:00",
"priority": "Normal",
"title": "Change16",
"description": "description"
}'
- Get a single list item by id:
curl --location --request GET 'http://localhost:8080/todo/4'
- Edit an existing item to the list:
curl --location --request POST 'http://localhost:8080/todo/4' \
--header 'Content-Type: application/json' \
--data-raw '{
"mbTitle": "Change17"
}'
- Delete single list item by id:
curl --location --request DELETE 'http://localhost:8080/todo/6'