stack build
stack exec run-server
docker-compose up web
docker-compose run web stack exec migrate-db
when you make changes just run docker-compose build
access the container postgres instance: docker exec -it myblog_db_1 psql -U myblog
docker-compose down
docker-compose build
docker-compose up web
Right now I'm using test-framework and HUnit but I've read good things about using tasty
- edit
stack.yml
dependencies list - run
stack install
Note: do not edit the generated .cabal
file
NOTE: once you add packages, you'll probably want to publish a new docker image so that you don't have to go through the install step everytime you run docker-compose build
:
docker-compose build
docker tag myblog_web willisplummer/haskell-blog:latest
docker push willisplummer/haskell-blog:latest
deploy to heroku via docker registry
heroku container:login
heroku container:push web -a haskell-blog
heroku container:release web -a haskell-blog
heroku open -a haskell-blog
[ ] look into using release phase to run migrations as part of deploy
- login emails shouldnt be case sensitive
unauthenticated routes
POST /signup
- create new user
POST /login
- authenticate
authenticated routes
GET /judgeables
- get judgeables index
GET /judgeables/id
- get judgeable by id
POST /judgeables
- create new judgeable
POST /judgeables/id/judgements
- create judgement for judgeable item
GET /users
- get users
GET /users/id/judgements
- get a user's judgements
POST /users/id/subscribe
- create a subscription to a user's judgements
curl --header "Content-Type: application/json; charset=utf-8" --verbose --data '{"email": "willisplummer@gmail.com", "password": "password", "username": "wmp224"}' https://e6cdfc21.ngrok.io/signup
curl --header "Content-Type: application/json; charset=utf-8" --verbose --data '{"email": "willisplummer@gmail.com", "password": "password"}' https://e6cdfc21.ngrok.io/login