piece-of-cake-slayer

logo

GitHub CI

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'