Type Parameters

  • T

Hierarchy

  • Route

Methods

  • Bind registers one or multiple middleware handlers to the current route.

    Parameters

    Returns Route<T>

  • BindFunc registers one or multiple middleware functions to the current route.

    The registered middleware functions are "anonymous" and with default priority, aka. executes in the order they were registered.

    If you need to specify a named middleware (ex. so that it can be removed) or middleware with custom exec prirority, use the [Route.Bind] method.

    Parameters

    • Rest ...middlewareFuncs: ((e) => void)[]

    Returns Route<T>

  • Unbind removes one or more middlewares with the specified id(s) from the current route.

    It also adds the removed middleware ids to an exclude list so that they could be skipped from the execution chain in case the middleware is registered in a parent group.

    Anonymous middlewares are considered non-removable, aka. this method does nothing if the middleware id is an empty string.

    Parameters

    • Rest ...middlewareIds: string[]

    Returns Route<T>

Properties

action: ((e) => void)

Type declaration

    • (e): void
    • Parameters

      • e: T

      Returns void

method: string
middlewares: hook.Handler<T>[]
path: string

Generated using TypeDoc