Template project for a web application based on the cake-slayer architecture.
Run the following command
cabal build
or
stack build
(it will take a while when run for the first time)
Run PostgreSQL database in one terminal window:
docker run -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres:12
Run backend
cabal run piece-of-cake-slayer
Then open localhost:8000
in your browser.
Testing backend via curl
:
$ curl localhost:8080/items
$ curl -XPOST \
-H 'Content-Type: application/json' \
localhost:8080/createItem \
-d '{"tag": "Item", "text": "New item"}'
$ curl -XPOST \
-H 'Content-Type: application/json' \
localhost:8080/deleteItem \
-d '1'