respond-1.0.0: process and route HTTP requests and generate responses on top of WAI

Safe HaskellNone
LanguageHaskell2010

Web.Respond.Run

Contents

Description

contains the tools to build and run a RespondT app

Synopsis

using RespondT

respondApp Source

Arguments

:: MonadIO m 
=> FailureHandlers

however you want failures handled

-> (forall a. m a -> IO a)

how to unpeel your monad to IO

-> RespondT m ResponseReceived

your api - must respond.

-> Application

give this to warp or something

build an Application from a RespondT router stack.

respondAppDefault :: MonadIO m => (forall a. m a -> IO a) -> RespondT m ResponseReceived -> Application Source

it's respondApp with defaultHandlers passed in.

serveRespond :: MonadIO m => Port -> LoggerSet -> FailureHandlers -> (forall a. m a -> IO a) -> RespondT m ResponseReceived -> IO () Source

serve a RespondT router app using runWaiApp on respondApp.

serveRespondDefault :: MonadIO m => Port -> LoggerSet -> (forall a. m a -> IO a) -> RespondT m ResponseReceived -> IO () Source

serve a RespondT router app using runWaiApp on respondAppDefault

the simpler Respond

type RespondM a = RespondT IO a Source

RespondT stacked on top of IO; the simplest stack for handlers.

simpleRespondApp :: FailureHandlers -> RespondM ResponseReceived -> Application Source

build an Application out of a RespondM handler.

simpleRespondAppDefault :: RespondM ResponseReceived -> Application Source

build an Application out of a RespondM handler using the default error handlers

serveSimpleRespondDefault :: Port -> LoggerSet -> RespondM ResponseReceived -> IO () Source

serve a RespondM handler using the default error handlers