Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Routes a m b
- data Meta a = Meta {
- routeMethod :: !Method
- routePath :: !ByteString
- routeMeta :: a
- prepare :: Monad m => Routes a m b -> [(ByteString, RoutingReq -> m Response)]
- route :: Monad m => [(ByteString, RoutingReq -> m Response)] -> Request -> m Response
- addRoute :: Monad m => Method -> ByteString -> (a -> m Response) -> Predicate RoutingReq Error a -> Routes b m ()
- attach :: a -> Routes a m ()
- examine :: Routes a m b -> [Meta a]
- get :: Monad m => ByteString -> (a -> m Response) -> Predicate RoutingReq Error a -> Routes b m ()
- head :: Monad m => ByteString -> (a -> m Response) -> Predicate RoutingReq Error a -> Routes b m ()
- post :: Monad m => ByteString -> (a -> m Response) -> Predicate RoutingReq Error a -> Routes b m ()
- put :: Monad m => ByteString -> (a -> m Response) -> Predicate RoutingReq Error a -> Routes b m ()
- delete :: Monad m => ByteString -> (a -> m Response) -> Predicate RoutingReq Error a -> Routes b m ()
- trace :: Monad m => ByteString -> (a -> m Response) -> Predicate RoutingReq Error a -> Routes b m ()
- options :: Monad m => ByteString -> (a -> m Response) -> Predicate RoutingReq Error a -> Routes b m ()
- connect :: Monad m => ByteString -> (a -> m Response) -> Predicate RoutingReq Error a -> Routes b m ()
- patch :: Monad m => ByteString -> (a -> m Response) -> Predicate RoutingReq Error a -> Routes b m ()
- type Renderer = Error -> Maybe ByteString
- renderer :: Renderer -> Routes a m ()
Documentation
Data added to a route via attach
is returned in this Meta
record.
Meta | |
|
prepare :: Monad m => Routes a m b -> [(ByteString, RoutingReq -> m Response)] Source
Run the Routes
monad and return the handlers per path.
route :: Monad m => [(ByteString, RoutingReq -> m Response)] -> Request -> m Response Source
:: Monad m | |
=> Method | |
-> ByteString | path |
-> (a -> m Response) | handler |
-> Predicate RoutingReq Error a | |
-> Routes b m () |
:: Monad m | |
=> ByteString | path |
-> (a -> m Response) | handler |
-> Predicate RoutingReq Error a | |
-> Routes b m () |
:: Monad m | |
=> ByteString | path |
-> (a -> m Response) | handler |
-> Predicate RoutingReq Error a | |
-> Routes b m () |
:: Monad m | |
=> ByteString | path |
-> (a -> m Response) | handler |
-> Predicate RoutingReq Error a | |
-> Routes b m () |
:: Monad m | |
=> ByteString | path |
-> (a -> m Response) | handler |
-> Predicate RoutingReq Error a | |
-> Routes b m () |
:: Monad m | |
=> ByteString | path |
-> (a -> m Response) | handler |
-> Predicate RoutingReq Error a | |
-> Routes b m () |
:: Monad m | |
=> ByteString | path |
-> (a -> m Response) | handler |
-> Predicate RoutingReq Error a | |
-> Routes b m () |
:: Monad m | |
=> ByteString | path |
-> (a -> m Response) | handler |
-> Predicate RoutingReq Error a | |
-> Routes b m () |
:: Monad m | |
=> ByteString | path |
-> (a -> m Response) | handler |
-> Predicate RoutingReq Error a | |
-> Routes b m () |
:: Monad m | |
=> ByteString | path |
-> (a -> m Response) | handler |
-> Predicate RoutingReq Error a | |
-> Routes b m () |
type Renderer = Error -> Maybe ByteString Source
Function to turn an Error
value into a ByteString
.
Clients can provide their own renderer using renderer
.