How to do it...

  1. Create a new project, auth-in-snap, with a simple stack template:
        stack new auth-in-snap simple
  1. Add a dependency on the snap-core library in the build-depends subsection of the executable section.
  executable auth-in-snap
    hs-source-dirs:      src
    main-is:             Main.hs
    default-language:    Haskell2010
    build-depends:       base >= 4.7 && < 5
                       , snap-core
                       , snap-server
                       , snaplet-sqlite-simple
                       , heist
                       , snap
                       , lens
                       , bytestring
                       , text
                       , map-syntax
  1. Use the following command to solve the constraints within the current resolver. For this recipe, we have used lts-9.1 as a resolver:
  stack --resolver lts-9.1 solver --update-config
  1. Copy the archive from https://www.dropbox.com/s/hsprdjk5221r83c/auth-in-snap-templates.tar.gz?dl=0. It is a set of ...

Get Haskell Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.