Back to Pocketbase

Interface Route<T>

static/jsvm/interfaces/router.Route.html

latest2.5 KB
Original Source

Interface Route<T>

Type Parameters

T

Hierarchy

  • Route

Index

Methods

bindbindFuncunbind

Properties

actionmethodmiddlewarespath

Methods

bind

  • bind(...middlewares): Route<T>

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

Parameters

Rest ...middlewares: hook.Handler<T>[]

Returns Route<T>

bindFunc

  • bindFunc(...middlewareFuncs): 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

  • unbind(...middlewareIds): 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

action: ((e) => void)

Type declaration

    • (e): void

Parameters

- 
e: T

Returns void

method

method: string

middlewares

middlewares: hook.Handler<T>[]

path

path: string

Settings

Member Visibility

  • Inherited

Theme

OSLightDark

On This Page

Generated using TypeDoc