Middleware defines a single request middleware handler.

This class is usually used when you want to explicitly specify a priority to your custom route middleware.

Example:

routerUse(new Middleware((e) => {
console.log(e.request.url.path)
return e.next()
}, -10))

Hierarchy

  • Middleware

Constructors

Constructors

  • Parameters

    • func: string | ((e) => void)
    • Optional priority: number
    • Optional id: string

    Returns Middleware

Generated using TypeDoc