Skip to content
No description or website provided.
Haskell
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
src/Hack2/Interface
test
.gitignore
LICENSE
Nemesis
Setup.lhs
changelog.md
hack2-interface-wai.cabal
readme.md

readme.md

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 ....
Something went wrong with that request. Please try again.