@hackage hack2-interface-wai2017.1.4

Hack2 interface to WAI

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)