Safe Haskell | None |
---|---|
Language | Haskell98 |
Since 3.0.9
- routedMiddleware :: ([Text] -> Bool) -> Middleware -> Middleware
- hostedMiddleware :: ByteString -> Middleware -> Middleware
Documentation
:: ([Text] -> Bool) | Only use middleware if this pathInfo test returns True |
-> Middleware | middleware to apply the path prefix guard to |
-> Middleware | modified middleware |
Apply a middleware based on a test of pathInfo
example:
let corsify = routedMiddleWare ("static" `elem`) addCorsHeaders
Since 3.0.9
:: ByteString | Domain the middleware applies to |
-> Middleware | middleware to apply the path prefix guard to |
-> Middleware | modified middleware |
Only apply the middleware to certain hosts
Since 3.0.9