http-pony-serve-wai: Serve a WAI application with http-pony

[ bsd3, library, network ] [ Propose Tags ]

[Skip to Readme]
Versions [RSS] [faq],,,,
Change log
Dependencies attoparsec (>=0.13), base (==4.9.*), blaze-builder (>=, bytestring (>=0.10), case-insensitive (>=, http-pony-transformer-http (>=, http-pony-transformer-startline (>=, http-types (>=0.9.1), pipes (>=4.1), pipes-bytestring (>=2.1.3), pipes-safe (>=2.2.4), transformers (>=0.5.2), wai (>= [details]
License BSD-3-Clause
Author Jinjing Wang
Category Network
Home page
Uploaded by JinjingWang at 2016-09-24T08:42:37Z
Distributions NixOS:
Downloads 2404 total (14 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2016-09-24 [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees


Readme for http-pony-serve-wai-

[back to package description]

Starting from a WAI app

{-# LANGUAGE OverloadedStrings #-}

module Hello where

import           Network.HTTP.Pony.Serve.Wai (fromWAI)
import qualified Network.HTTP.Types as HTTP
import qualified Network.Wai as Wai

waiApp :: Wai.Application
waiApp request respond = do

  respond $ Wai.responseLBS
      [("Content-Type", "text/plain")]
      "Hello, WAI!"

hello = fromWAI waiApp

Serve with pony

{-# LANGUAGE OverloadedStrings #-}

module RunHello where

import Network.HTTP.Pony.Serve (run)
import Network.HTTP.Pony.Transformer.HTTP (http)
import Network.HTTP.Pony.Transformer.StartLine (startLine)
import Network.HTTP.Pony.Transformer.CaseInsensitive (caseInsensitive)

import Pipes.Safe (runSafeT)
import Hello (hello)

main :: IO ()
main = ( runSafeT
          . run "localhost" "8080"
          . http
          . startLine
          . caseInsensitive
        ) hello


  • Streaming response is not implemented.