@hackage hack2-interface-wai2012.5.24
Hack2 interface of WAI
Categories
License
BSD-3-Clause
Maintainer
Jinjing Wang <nfjinjing@gmail.com>
Links
- Homepage
- Documentation
- No source repository
- Changelog
- Security
Versions
Installation
Dependencies (14)
- air
- base >=4.0 && <=100
- blaze-builder
- bytestring
- case-insensitive
- containers Show all…
Dependents (2)
@hackage/acme-everything, @hackage/hack2-handler-warp
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)