Copyright | (c) Anupam Jain 2013 |
---|---|
License | MIT (see the file LICENSE) |
Maintainer | ajnsit@gmail.com |
Stability | experimental |
Portability | non-portable (uses ghc extensions) |
Safe Haskell | None |
Language | Haskell2010 |
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 Application Source
Convert a RouteM Monadic value into a wai application.