Documentation

Hale.WaiExtra.Network.Wai.Middleware.Routed

Apply middleware only to requests matching the given path predicate. $$\text{routed} : (\text{Request} \to \text{Bool}) \to \text{Middleware} \to \text{Middleware}$$

Equations
Instances For

    Apply middleware only to requests with the given path prefix. $$\text{routedPrefix} : \text{String} \to \text{Middleware} \to \text{Middleware}$$

    Equations
    Instances For
      theorem Network.Wai.Middleware.routed_true (middle : Middleware) :
      routed (fun (x : Request) => true) middle = middle

      Routing with always-true predicate applies the middleware.

      theorem Network.Wai.Middleware.routed_false (middle : Middleware) :
      routed (fun (x : Request) => false) middle = id

      Routing with always-false predicate is identity.