Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 91a6cb81d8
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (19 sloc) 609 Bytes

Interfacing Hack2 and Wai

Example: test/hello

{-# LANGUAGE OverloadedStrings #-}

import Hack2 
import Hack2.Interface.Wai (hackAppToWaiApp)
import Data.Default (def)
import Network.Wai.Handler.Warp (run)

app :: Application
app = \env -> 
  return $ 
      Response 200 [ ("Content-Type", "text/plain") ] "Hello World (Hack2 to Wai)"

main :: IO ()
main = do
    putStrLn $ "http://localhost:3000/"
    run 3000 (hackAppToWaiApp app)

Known issues

  • Request input body is not preserved by this interface ....
Jump to Line
Something went wrong with that request. Please try again.