Template project for a web application based on the cake-slayer architecture.
How to build?๐
Backend๐
Run the following command
cabal build
or
stack build
(it will take a while when run for the first time)
Frontend๐
How to run?๐
Database๐
Run PostgreSQL database in one terminal window:
docker run -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres:12
Backend๐
Run backend
cabal run piece-of-cake-slayer
Frontend๐
Then open localhost:8000
in your browser.
Test๐
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'