- Install MongoDB. On Mac:
brew install mongo
- Create database directory:
mkdir db
- Build and install:
cabal install
- Now you have an executable
beercounter
Start the mongoDB server:
start-mongo.sh
Start beercounter:
beercounter
Start GHCI with beercounter
source directories:
./repl
Load Server.hs
and start it:
:l Server
main
Server is now running. Use Ctrl-C
to stop it and :q
to exit GHCI.
Build with cabal:
cabal install
Buy a round:
curl -d '{"buyer":"juha", "others":["juho", "atte"]}' localhost:8000/buyRound
Check karma:
curl localhost:8000/karma/juho/atte