The snap-server package

[Tags: bsd3, library]

This is the first developer prerelease of the Snap framework. Snap is a simple and fast web development framework and server written in Haskell. For more information or to download the latest version, you can visit the Snap project website at http://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 planned but not yet implemented, so this release will mostly be of interest for those who:


[Skip to ReadMe]

Properties

Versions0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.2.1, 0.2.2, 0.2.4, 0.2.5, 0.2.6, 0.2.7, 0.2.7.1, 0.2.7.2, 0.2.8, 0.2.8.1, 0.2.9, 0.2.10, 0.2.10.1, 0.2.10.2, 0.2.11, 0.2.12, 0.2.13, 0.2.13.1, 0.2.13.2, 0.2.13.3, 0.2.14, 0.2.14.1, 0.2.15, 0.2.15.1, 0.2.16, 0.2.16.1, 0.2.16.2, 0.3.0, 0.3.1, 0.3.1.1, 0.4.0, 0.4.0.1, 0.4.0.2, 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.1.4, 0.5.2, 0.5.3, 0.5.3.1, 0.5.4, 0.5.5, 0.6.0, 0.6.0.1, 0.7, 0.7.0.1, 0.8.0, 0.8.0.1, 0.8.1, 0.8.1.1, 0.9.0, 0.9.2, 0.9.2.1, 0.9.2.2, 0.9.2.3, 0.9.2.4, 0.9.3, 0.9.3.1, 0.9.3.3, 0.9.3.4, 0.9.4.0, 0.9.4.1, 0.9.4.2, 0.9.4.3, 0.9.4.4, 0.9.4.5, 0.9.4.6, 0.9.5.0, 0.9.5.1
Change logNone available
Dependenciesarray (>=0.2 && <0.4), attoparsec (>=0.8.1 && <0.9), attoparsec-iteratee (>=0.1.1 && <0.2), base (==4.*), binary (==0.5.*), bytestring, bytestring-nums, bytestring-show (>=0.3.2 && <0.4), cereal (==0.3.*), containers, directory-tree, dlist (==0.5.*), filepath, hlibev (>=0.2.8 && <0.3), iteratee (>=0.3.1 && <0.4), monads-fd (<0.1.0.3), murmur-hash (==0.1.*), network (==2.2.1.*), network-bytestring (>=0.1.2 && <0.2), old-locale, PSQueue (==1.1.*), snap-core (==0.2.16), template-haskell, time, transformers, unix, unix-compat, vector (==0.7.*), vector-algorithms (>=0.3.4 && <0.4) [details]
LicenseBSD3
AuthorJames Sanders, Gregory Collins, Doug Beardsley
Maintainersnap@snapframework.com
CategoryWeb
Home pagehttp://snapframework.com/
Source repositoryhead: git clone http://git.snapframework.com/snap-server.git
UploadedWed Nov 10 20:14:32 UTC 2010 by GregoryCollins
DistributionsDebian:0.9.5.1, Fedora:0.9.4.6, FreeBSD:0.9.4.5, LTSHaskell:0.9.5.1, NixOS:0.9.5.1, Stackage:0.9.5.1
Downloads36514 total (1335 in last 30 days)
Votes
3 []
StatusDocs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Flags

NameDescriptionDefault
libevUse libev?Disabled
portableCompile in cross-platform mode. No platform-specific code or optimizations such as C routines will be used.Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for snap-server-0.2.16

Snap Framework HTTP Server Library

This is the first developer prerelease of 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:

or

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).

The snap-server library can optionally use the libev for high-speed, O(1) scalable socket event processing.

Building snap-server

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

cabal install

for the "stock" version of Snap or

cabal install -flibev

for the libev-based backend.

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

Snap is still in its very early stages, so most of the "action" (and a big chunk of the code) right now is centred on the test suite. Snap aims for 100% test coverage, and we're trying hard to stick to that.

To build the test suite, cd into the test/ directory and run

$ cabal configure            # for the stock backend
$ cabal configure -flibev    # for the libev 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.

The test cabal project also builds an executable called "pongserver" which is a test HTTP server, hardcoded to run on port 8000:

$ ./dist/build/pongserver/pongserver +RTS -A4M -N4 -qg0 -qb -g1

(Those are the RTS settings that give me the highest performance on my quad-core Linux box running GHC 6.12.1, your mileage may vary.)

This server just outputs "PONG" but it is a complete example of an HTTP application (FIXME: currently this isn't true, we need to make pongserver run in the still-incomplete Snap monad):

$ curl -i http://localhost:8000
HTTP/1.1 200 OK
Content-Length: 4
Date: Sun, 14 Mar 2010 03:17:45 GMT
Server: Snap/0.pre-1

PONG