routes :: RouterT (MiddlewareT m) sec m ()
routes = do
matchHere $ action $ do
get $ do
json ("some cool json", True, 12) -- application/json
text "Yo" -- text/plain
matchGroup (l_ "someChunk" </> o_) $ do
match (p_ "some parser" Attoparsec.doube </> o_) $ \(d :: Double) -> -- "/someChunk/124.234" would match
action $ ...
matchGroup (r_ [regex|/^(\.)+(.*)/|] </> o_) $ \(matches :: [String]) -> -- "/someChunk/....huh?" would match
action $ ...
myMiddleware :: MiddlewareT m
myMiddleware = route routes
-
Notifications
You must be signed in to change notification settings - Fork 1
Declarative, Compositional Url Handling for WAI
License
athanclark/nested-routes
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Declarative, Compositional Url Handling for WAI
Topics
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published