File: Main.hs

package info (click to toggle)
haskell-snap-server 0.9.4.5-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 428 kB
  • sloc: haskell: 4,300; sh: 46; makefile: 2
file content (36 lines) | stat: -rw-r--r-- 527 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE Rank2Types #-}

module Main where

import           Control.Concurrent
import           Control.Exception (finally)

import           Snap.Http.Server
import           Test.Common.TestHandler


{-

/pong
/fileserve
/echo
pipelined POST requests
slowloris attack / timeout test

-}


main :: IO ()
main = do
    m <- newEmptyMVar

    forkIO $ go m
    takeMVar m

    return ()

  where
    go m = quickHttpServe testHandler `finally` putMVar m ()