snap: Top-level package for the Snap Web Framework

[ bsd3, library, snap, web ] [ Propose Tags ] [ Report a vulnerability ]

This is the top-level package for the official Snap Framework libraries. It includes:

  • The Snaplets API

  • Snaplets for sessions, authentication, and templates

To get started, issue the following sequence of commands:

$ cabal install snap snap-templates
$ mkdir myproject
$ cd myproject
$ snap init

If you have trouble or any questions, see our FAQ page (http://snapframework.com/faq) or the documentation (http://snapframework.com/docs).

Note: since version 1.0, the "snap" executable program for generating starter projects is provided by the snap-templates package.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.3.0, 0.3.0.1, 0.3.1, 0.4, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.5.1, 0.5.1.1, 0.5.1.2, 0.5.1.3, 0.5.2, 0.5.3, 0.5.3.1, 0.5.4, 0.5.5, 0.5.5.1, 0.6.0, 0.6.0.1, 0.6.0.2, 0.7, 0.8.0, 0.8.0.1, 0.8.0.2, 0.8.1, 0.9.0, 0.9.0.1, 0.9.1, 0.9.1.1, 0.9.2, 0.9.2.1, 0.9.2.2, 0.10.0, 0.10.0.1, 0.11.0, 0.11.1, 0.11.2, 0.11.2.1, 0.11.2.2, 0.11.3, 0.11.3.1, 0.12.0, 0.12.1, 0.13.0, 0.13.0.1, 0.13.0.2, 0.13.0.3, 0.13.0.4, 0.13.1, 0.13.1.1, 0.13.1.2, 0.13.2.0, 0.13.2.1, 0.13.2.2, 0.13.2.3, 0.13.2.4, 0.13.2.5, 0.13.2.6, 0.13.2.7, 0.13.2.8, 0.13.2.9, 0.13.3, 0.13.3.1, 0.13.3.2, 0.14.0, 0.14.0.1, 0.14.0.2, 0.14.0.3, 0.14.0.4, 0.14.0.5, 0.14.0.6, 0.14.0.7, 1.0.0.0, 1.0.0.1, 1.0.0.2, 1.1.0.0, 1.1.1.0, 1.1.2.0, 1.1.3.0, 1.1.3.1, 1.1.3.2, 1.1.3.3
Change log changelog.md
Dependencies aeson (>=0.6 && <2.3), attoparsec (>=0.10 && <0.15), attoparsec-aeson (>=2.1.0.0 && <3.0), base (>=4.5 && <5), bytestring (>=0.9.1 && <0.13), cereal (>=0.3 && <0.6), clientsession (>=0.8 && <0.10), configurator (>=0.1 && <0.4), containers (>=0.2 && <0.8), directory (>=1.1 && <1.4), directory-tree (>=0.11 && <0.13), dlist (>=0.5 && <1.1), fail (>=4.9 && <4.10), filepath (>=1.3 && <2), hashable (>=1.2.0.6 && <2), heist (>=1.1 && <1.2), lens (>=3.7.6 && <5.4), lifted-base (>=0.2 && <0.3), map-syntax (>=0.2 && <0.4), monad-control (>=0.3 && <1.1), mtl (>=2.0 && <2.4), mwc-random (>=0.8 && <0.16), pwstore-fast (>=2.2 && <2.5), semigroups (>=0.16 && <0.19), snap-core (>=1.0 && <1.1), snap-server (>=1.0 && <1.2), stm (>=2.2 && <2.6), text (>=1.1.1.0 && <2.2), time (>=1.1 && <2), transformers (>=0.2 && <0.7), transformers-base (>=0.4 && <0.5), unordered-containers (>=0.1.4 && <0.3), xmlhtml (>=0.1 && <0.3) [details]
Tested with ghc ==8.8.4, ghc ==8.10.7, ghc ==9.0.2, ghc ==9.2.8, ghc ==9.4.5, ghc ==9.6.2
License BSD-3-Clause
Author Ozgun Ataman, Doug Beardsley, Gregory Collins, Carl Howells, Chris Smith
Maintainer snap@snapframework.com
Revised Revision 3 made by cydparser at 2024-07-04T22:54:15Z
Category Web, Snap
Home page http://snapframework.com/
Bug tracker https://github.com/snapframework/snap/issues
Source repo head: git clone https://github.com/snapframework/snap.git
Uploaded by cydparser at 2023-10-23T17:15:56Z
Distributions Debian:1.1.3.0, FreeBSD:0.14.0.6, LTSHaskell:1.1.3.3, NixOS:1.1.3.3, Stackage:1.1.3.3
Reverse Dependencies 66 direct, 0 indirect [details]
Downloads 100115 total (358 in the last 30 days)
Rating 2.5 (votes: 6) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-10-23 [all 1 reports]

Readme for snap-1.1.3.3

[back to package description]

Snap Framework Hackage Status

GitHub CI

Snap is a simple and fast web development framework and server written in Haskell. For more information about Snap, read the README.SNAP.md or visit the Snap project website at http://www.snapframework.com/.

Library contents

This is top-level project for the Snap Framework, which contains:

  • a library allowing Snap applications to recompile actions on the fly in development mode, with no performance loss in production mode.

  • a "snaplet" API allowing web applications to be build from composable pieces.

The command-line utility snap for creating initial Snap applications used to be a part of this package. As of version 1.0, the snap command-line utility is no longer provided by this package. It is now provided by the package snap-templates.

Building snap

After you clone the repository, change to the newly created snap directory and run

git submodule update --init --recursive
./init-sandbox.sh
cabal install

(You may want to look at pull.sh or pullLatestMaster.sh.) This updates all the Snap Framework dependencies to the correct version, creates a sandbox, and installs everything. The snap library is built using Cabal and Hackage.

Building the Haddock Documentation

The haddock documentation can be built using 'cabal haddock'.

The docs get put in dist/doc/html/.

Building the testsuite

To build the test suite, run

$ cabal clean
$ cabal configure --enable-tests --enable-library-coverage
$ cabal build
$ cabal install --enable-tests

From here you can invoke the testsuite by running:

$ ./runTestsAndCoverage.sh

The testsuite generates an hpc test coverage report in dist/hpc.

Roadmap to Understanding Snaplets

  1. Read Tutorial.lhs which is in the project_template/tutorial/src directory of the snap-templates package.
  2. Generate and read the haddock docs.
  3. The test code has the nice property that it actually functions as a pretty good example app and covers a lot of the use cases.
  4. If you're interested in the implementation, read design.md.