Snap Framework HTTP Server

repository·master·Indexed 41 days ago

https://github.com/snapframework/snap-server

A high-performance web server library written in Haskell that provides an efficient interface to the HTTP protocol, building upon the snap-core library. It supports Unix platforms, including Linux and Mac OSX, and offers optional SSL support via OpenSSL.

Tokens
573
Snippets
3
Records
5
Agent score
2%

What's inside Snap

  1. Overview of the Snap Framework

    master

    Snap is a high-performance web development framework and server written in Haskell. It is designed to be a comprehensive web toolkit that balances high performance with simplicity and ease of use, even for those new to Haskell.

    Key components of the Snap ecosystem include:

    • snap-server: A high-speed HTTP server.
    • Heist: An XML-based templating system used for generating HTML. It allows developers to bind Haskell functionality to XML tags, avoiding the complexity of mixing logic and markup (often referred to as 'tag soup').
    • Snaplets: A system for building websites using composable, modular pieces.
    • Monadic Interface: A clean and sensible monad specifically designed for web programming tasks.
  2. Install snap-server via Cabal

    master

    To install the Snap HTTP server library, use the Haskell cabal build tool. By default, it installs the standard HTTP server. If you require SSL support, you must have the openssl library installed on your system and enable the openssl flag during installation.

    # Standard installation
    cabal install
    
    # Installation with SSL support
    cabal install -fopenssl
  3. Build and run the snap-server testsuite

    master

    To run the comprehensive test suite and generate coverage reports, navigate to the test/ directory and follow these steps:

    1. Configure the project (choose the backend appropriate for your needs).
    2. Build the project.
    3. Execute the test runner script.

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

    cd test/
    
    # Configure for stock backend
    cabal configure
    # OR configure for SSL backend
    cabal configure -fopenssl
    
    cabal build
    
    # Run the tests
    ./runTestsAndCoverage.sh