Snap 1.0 isn’t on Hackage yet, but here’s how you can play with it now.
NOTE: This was written using ghc-7.8.3. The repo is on GitHub
First we’ll make a new directory for the project and one for the dependencies, then clone the dependencies for 1.0 that aren’t on Hackage:
We should have a file structure that looks like this:
We can now get a scaffolded app using
snap-templates gives us the
that we used to use from the
snap project. In the project
root, let’s init a new scaffold:
Which leaves us with this structure at the top level:
If you haven’t created a new sandbox for this project, do that now and install the dependencies for the scaffold into the sandbox.
We can’t build the app yet, since the scaffold is missing
two things. We need to add
map-syntax as a dependency to
auth-server.cabal and we need to replace
noSplices has been deprecated.
Next, we need to add two imports to
as well as replace
We can now build and run the project:
We now have a working Snap 1.0 app to play with. In a future blog post, we’ll explore the creation of a Users service.