/pinfold

wip snap application

Primary LanguageHaskell

pinfold (wip)

development

Note: a binary should be run with the current working directory as the root of the repository, with the proper snaplets configs set up.

GHC/Haskell packages

Using Nix:

nix-shell
cabal configure -fdevelopment
cabal install --bindir=./bin

./bin/pinfold # starts a server on localhost:8000

Running ghci:

nix-shell --command 'ghci'

Postgres

Make sure Postgres is up and running.

To set up the database, you first need to create and edit the database configuration in snaplets/postgresql-simple/devel.cfg and in snaplets/postgresql-simple/test.cfg. There is an example config in that directory.

cd ./snaplets/postgresql-simple

cp devel.cfg.example devel.cfg
cp devel.cfg.example test.cfg

# now edit devel.cfg and test.cfg with the appropriate settings
# make sure you use different databases!

chmod 600 devel.cfg test.cfg

cd ../../

# warning: this will wipe out the databases defined in devel.cfg and
# in test.cfg if they exist
./db/init

Testing

This will create the test database and run cabal test (you should run this from within nix-shell if you use nix):

./bin/run_tests