Safe Haskell | None |
---|---|
Language | Haskell2010 |
Web.Route.Invertible.Wai
Description
A compatibility routing layer for WAI applications.
Synopsis
- module Web.Route.Invertible.Common
- waiRequest :: Request -> Request
- routeWai :: Request -> RouteMap a -> Either (Status, ResponseHeaders) a
- routeWaiError :: (Status -> ResponseHeaders -> Request -> a) -> RouteMap (Request -> a) -> Request -> a
- routeWaiApplicationError :: (Status -> ResponseHeaders -> Application) -> RouteMap Application -> Application
- routeWaiApplication :: RouteMap Application -> Application
Documentation
module Web.Route.Invertible.Common
routeWai :: Request -> RouteMap a -> Either (Status, ResponseHeaders) a Source #
Lookup a wai request in a route map, returning either an error code and headers or a successful result.
routeWaiError :: (Status -> ResponseHeaders -> Request -> a) -> RouteMap (Request -> a) -> Request -> a Source #
Combine a set of applications in a routing map into a single application, calling a custom error handler in case of routing error.
routeWaiApplicationError :: (Status -> ResponseHeaders -> Application) -> RouteMap Application -> Application Source #
Equivalent to routeWaiError
.
routeWaiApplication :: RouteMap Application -> Application Source #
Combine a set of applications in a routing map into a single application, returning an empty error response in case of routing error.