@hackage hack2-interface-wai2017.1.4
Hack2 interface to WAI
Categories
License
BSD-3-Clause
Maintainer
Jinjing Wang <nfjinjing@gmail.com>
Links
- Homepage
- Documentation
- No source repository
- Changelog
- Security
Versions
Installation
Dependencies (10)
- base >=4.8 && <5
- bytestring
- containers
- case-insensitive
- data-default >=0.2
- hack2 >=2011.6.20 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)