web-inv-route-0.1.2.3: Composable, reversible, efficient web routing using invertible invariants and bijections
Safe HaskellNone
LanguageHaskell2010

Web.Route.Invertible.Wai

Description

A compatibility routing layer for WAI applications.

Synopsis

Documentation

waiRequest :: Request -> Request Source #

Convert a Request to a request.

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.

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.