hack2-interface-wai: Hack2 interface of WAI

[ bsd3, library, web ] [ Propose Tags ]
Versions 2012.5.24, 2012.5.25, 2017.1.4
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 BSD-3-Clause
Author Jinjing Wang
Maintainer Jinjing Wang <nfjinjing@gmail.com>
Category Web
Home page https://github.com/nfjinjing/hack2-interface-wai
Uploaded by JinjingWang at Thu May 24 14:26:52 UTC 2012
Distributions NixOS:2017.1.4
Downloads 1032 total (14 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI

Hack2 interface of WAI

[Skip to Readme]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for hack2-interface-wai-2012.5.24

[back to package description]

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)