Safe Haskell | Safe-Infered |
---|
- type Route = [Text] -> Maybe Application
- router :: [Route] -> Application -> Application
- dir :: Text -> Application -> Route
Documentation
type Route = [Text] -> Maybe ApplicationSource
Alias for a function which maps path pieces to applications.
router :: [Route] -> Application -> ApplicationSource
Router for mapping paths to applications.
For example:
router [ dir "/foo" fooApp , dir "/api" apiApp ] defaultApp
dir :: Text -> Application -> RouteSource
A possible web application if the path matches, nothing otherwise.