snap-server

A fast, iteratee-based, epoll-enabled web server for the Snap Framework http://snapframework.com/

Version on this page:[email protected]:2
LTS Haskell 15.14:1.1.1.2
Stackage Nightly 2020-05-26:1.1.1.2
Latest on Hackage:1.1.1.2

See all snapshots snap-server appears in

BSD-3-Clause licensed by James Sanders, Gregory Collins, Doug Beardsley
Maintained by [email protected]

Module documentation for 0.9.5.1

This version can be pinned in stack with:[email protected]:4714994da541f840c1d2afd300bf6e85ad93ad04e5fe96f5bba9e08b000b248d,5136

Snap Framework HTTP Server Library

This is the Snap Framework HTTP Server library. For more information about Snap, read the README.SNAP.md or visit the Snap project website at http://www.snapframework.com/.

The Snap HTTP server is a high performance, epoll-enabled, iteratee-based web server library written in Haskell. Together with the snap-core library upon which it depends, it provides a clean and efficient Haskell programming interface to the HTTP protocol. Higher-level facilities for building web applications (like user/session management, component interfaces, data modeling, etc.) are not yet implemented, so this release will mostly be of interest for those who:

  • need a fast and minimal HTTP API at roughly the same level of abstraction as Java servlets,

or

  • are interested in contributing to the Snap Framework project.

Building snap-server

Dependencies

To build the Snap HTTP server, you need to cabal install the snap-core library (which should have come with this package).

Optional dependencies

If you would like SSL support, snap-server requires the openssl library.

Building snap-server

The snap-server library is built using Cabal and Hackage. Just run

cabal install

to install snap-server.

If you would like SSL support, pass the openssl flag to cabal install:

cabal install -fopenssl

Building the Haddock Documentation

The haddock documentation can be built using the supplied haddock.sh shell script:

./haddock.sh

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

Building the testsuite

The snap-server has a fairly comprehensive test suite. To build and run it, cd into the test/ directory and run

$ cabal configure            # for the stock backend, or..
$ cabal configure -fopenssl  # for the SSL backend

$ cabal build

From here you can invoke the testsuite by running:

$ ./runTestsAndCoverage.sh 

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