Interface BaseRouterHandlerArgs<T>

interface BaseRouterHandlerArgs<T> {
    allowedMethods?: string[];
    allowedPathNames?: string[];
    baseUrl?: string;
    handler: T;
}

Type Parameters

Hierarchy (view full)

Properties

allowedMethods?: string[]

The allowed method(s). * can be used to indicate all methods are allowed. Default is [ '*' ].

allowedPathNames?: string[]

Regular expression(s) used to match the target URL. The base URl without trailing slash will be stripped of before applying the regular expressions, so the input will always start with a /. Default is [ '.*' ].

baseUrl?: string

The base URL of the server. Not required if no value is provided for allowedPathNames.

handler: T

The handler to call if all checks pass.