Portability | non-portable (uses ghc extensions) |
---|---|
Stability | experimental |
Maintainer | ajnsit@gmail.com |
Safe Haskell | None |
Defines a Routing Monad that provides easy composition of Routes
- data RouteM a
- defaultAction :: Application -> RouteM ()
- middleware :: Middleware -> RouteM ()
- route :: Routable master => master -> RouteM ()
- toWaiApp :: RouteM () -> IO Application
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.