The hack2-interface-wai package

[Tags:bsd3, library]

Hack2 interface of WAI


[Skip to Readme]

Properties

Versions 2012.5.24, 2012.5.25
Change log changelog.md
Dependencies air, base (>=4.0 && <=100), blaze-builder, bytestring, case-insensitive, containers, data-default (>=0.2), enumerator, hack2 (>=2011.6.20), http-types, mtl, network, safe, wai [details]
License BSD3
Author Jinjing Wang
Maintainer Jinjing Wang <nfjinjing@gmail.com>
Stability Unknown
Category Web
Home page https://github.com/nfjinjing/hack2-interface-wai
Uploaded Thu May 24 14:26:52 UTC 2012 by JinjingWang
Distributions
Downloads 447 total (6 in the last 30 days)
Votes
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for hack2-interface-wai

Readme for hack2-interface-wai-2012.5.24

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)