Skip to content

Workery / routing / Router

Class: Router<E>

routing.Router

Type parameters

NameType
Eunknown

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Router<E>(init): Router<E>

Type parameters

NameType
Eunknown

Parameters

NameType
initObject
init.tags?string[]
init.deprecated?boolean
init.includeInSchema?boolean
init.responses?Record<number, ResponseConfig>
init.defaultResponseClass?ResponseClass

Returns

Router<E>

Defined in

src/routing.ts:272

Properties

tags

tags: string[]

Defined in

src/routing.ts:265


deprecated

deprecated: boolean

Defined in

src/routing.ts:266


includeInSchema

includeInSchema: boolean

Defined in

src/routing.ts:267


responses

responses: Record<number, ResponseConfig>

Defined in

src/routing.ts:268


defaultResponseClass

defaultResponseClass: ResponseClass

Defined in

src/routing.ts:269


routeMatcher

routeMatcher: RouteMatcher<E>

Defined in

src/routing.ts:270

Methods

get

get<R, Ps>(path, unboundRoute): Route<R, Ps, E>

Type parameters

NameType
RR
Psextends RouteParameters

Parameters

NameType
pathstring
unboundRouteUnboundRoute<R, Ps, E>

Returns

Route<R, Ps, E>

Defined in

src/routing.ts:300


post

post<R, Ps>(path, unboundRoute): Route<R, Ps, E>

Type parameters

NameType
RR
Psextends RouteParameters

Parameters

NameType
pathstring
unboundRouteUnboundRoute<R, Ps, E>

Returns

Route<R, Ps, E>

Defined in

src/routing.ts:306


put

put<R, Ps>(path, unboundRoute): Route<R, Ps, E>

Type parameters

NameType
RR
Psextends RouteParameters

Parameters

NameType
pathstring
unboundRouteUnboundRoute<R, Ps, E>

Returns

Route<R, Ps, E>

Defined in

src/routing.ts:312


delete

delete<R, Ps>(path, unboundRoute): Route<R, Ps, E>

Type parameters

NameType
RR
Psextends RouteParameters

Parameters

NameType
pathstring
unboundRouteUnboundRoute<R, Ps, E>

Returns

Route<R, Ps, E>

Defined in

src/routing.ts:318


patch

patch<R, Ps>(path, unboundRoute): Route<R, Ps, E>

Type parameters

NameType
RR
Psextends RouteParameters

Parameters

NameType
pathstring
unboundRouteUnboundRoute<R, Ps, E>

Returns

Route<R, Ps, E>

Defined in

src/routing.ts:324


head<R, Ps>(path, unboundRoute): Route<R, Ps, E>

Type parameters

NameType
RR
Psextends RouteParameters

Parameters

NameType
pathstring
unboundRouteUnboundRoute<R, Ps, E>

Returns

Route<R, Ps, E>

Defined in

src/routing.ts:330


trace

trace<R, Ps>(path, unboundRoute): Route<R, Ps, E>

Type parameters

NameType
RR
Psextends RouteParameters

Parameters

NameType
pathstring
unboundRouteUnboundRoute<R, Ps, E>

Returns

Route<R, Ps, E>

Defined in

src/routing.ts:336


options

options<R, Ps>(path, unboundRoute): Route<R, Ps, E>

Type parameters

NameType
RR
Psextends RouteParameters

Parameters

NameType
pathstring
unboundRouteUnboundRoute<R, Ps, E>

Returns

Route<R, Ps, E>

Defined in

src/routing.ts:342


route

route<R, Ps>(method, path, unboundRoute): Route<R, Ps, E>

Type parameters

NameType
RR
Psextends RouteParameters

Parameters

NameType
methodHTTPMethod
pathstring
unboundRouteUnboundRoute<R, Ps, E>

Returns

Route<R, Ps, E>

Defined in

src/routing.ts:349