hack2-interface-wai: Hack2 interface to WAI

[ bsd3, library, web ] [ Propose Tags ]

Convert a Hack2 App to a WAI app

[Skip to Readme]




Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 2012.5.24, 2012.5.25, 2017.1.4
Change log changelog.md
Dependencies base (>=4.8 && <5), bytestring, case-insensitive, containers, data-default (>=0.2), hack2 (>=2011.6.20), http-types, 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 2017-01-04T09:22:01Z
Distributions NixOS:2017.1.4
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 2563 total (13 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-01-04 [all 1 reports]

Readme for hack2-interface-wai-2017.1.4

[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)