The hack2-interface-wai package

[Tags: bsd3, library]

Hack2 interface of WAI


[Skip to ReadMe]

Properties

Versions2012.5.24, 2012.5.25
Change logchangelog.md
Dependenciesair, 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]
LicenseBSD3
AuthorJinjing Wang
MaintainerJinjing Wang <nfjinjing@gmail.com>
CategoryWeb
Home pagehttps://github.com/nfjinjing/hack2-interface-wai
UploadedThu May 24 14:26:52 UTC 2012 by JinjingWang
DistributionsNixOS:2012.5.25
Downloads332 total (15 in last 30 days)
Votes
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

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)