wai-routes-0.5.1: Typesafe URLs for Wai applications.

Portabilitynon-portable (uses ghc extensions)
Stabilityexperimental
Maintainerajnsit@gmail.com
Safe HaskellNone

Network.Wai.Middleware.Routes.Monad

Contents

Description

Defines a Routing Monad that provides easy composition of Routes

Synopsis

Route Monad

data RouteM a Source

The Route Monad

Compose Routes

defaultAction :: Application -> RouteM ()Source

Set the default action of the Application. You should only call this once in an application. Subsequent invocations override the previous settings.

middleware :: Middleware -> RouteM ()Source

Add a middleware to the application. Middleware is nested so the one declared earlier is outer.

route :: Routable master => master -> RouteM ()Source

Add a route to the application. Routes are ordered so the one declared earlier is matched first.

Convert to Wai Application

toWaiApp :: RouteM () -> IO ApplicationSource

Convert a RouteM Monadic value into a wai application.