wai-extra-3.0.29.2: Provides some basic WAI handlers and middleware.

Safe HaskellNone
LanguageHaskell2010

Network.Wai.Middleware.Routed

Description

Since 3.0.9

Synopsis

Documentation

routedMiddleware Source #

Arguments

:: ([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

hostedMiddleware Source #

Arguments

:: 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