Skip to content

Workery


Workery / applications / App

Class: App<E> ​

Defined in: src/applications.ts:24

Extends ​

Type Parameters ​

E ​

E = unknown

Constructors ​

Constructor ​

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

Defined in: src/applications.ts:44

Parameters ​

init ​
rootPath? ​

string

title? ​

string

description? ​

string

version? ​

string

tagsInfo? ​

TagObject[]

servers? ​

ServerObject[]

contact? ​

ContactObject

license? ​

LicenseObject

termsOfService? ​

string

securitySchemes? ​

Record<string, SecuritySchemeObject>

security? ​

SecurityRequirementObject[]

openapiUrl? ​

null | string

swaggerUrl? ​

null | string

redocUrl? ​

null | string

middleware? ​

Middleware<E>[]

exceptionHandler? ​

ExceptionHandler<E>

tags? ​

string[]

deprecated? ​

boolean

includeInSchema? ​

boolean

responses? ​

Record<number, ResponseConfig>

defaultResponseClass? ​

ResponseClass

Returns ​

App<E>

Overrides ​

Router.constructor

Properties ​

rootPath ​

rootPath: string

Defined in: src/applications.ts:25


title ​

title: string

Defined in: src/applications.ts:26


description ​

description: string

Defined in: src/applications.ts:27


version ​

version: string

Defined in: src/applications.ts:28


tagsInfo ​

tagsInfo: TagObject[]

Defined in: src/applications.ts:29


servers ​

servers: ServerObject[]

Defined in: src/applications.ts:30


contact? ​

optional contact: ContactObject

Defined in: src/applications.ts:31


license? ​

optional license: LicenseObject

Defined in: src/applications.ts:32


termsOfService? ​

optional termsOfService: string

Defined in: src/applications.ts:33


securitySchemes ​

securitySchemes: Record<string, SecuritySchemeObject>

Defined in: src/applications.ts:34


security ​

security: SecurityRequirementObject[]

Defined in: src/applications.ts:35

Overrides ​

Router.security


openapiUrl ​

openapiUrl: null | string

Defined in: src/applications.ts:36


swaggerUrl ​

swaggerUrl: null | string

Defined in: src/applications.ts:37


redocUrl ​

redocUrl: null | string

Defined in: src/applications.ts:38


middleware ​

middleware: Middleware<E>[]

Defined in: src/applications.ts:39

Overrides ​

Router.middleware


exceptionHandler ​

exceptionHandler: ExceptionHandler<E>

Defined in: src/applications.ts:40


fetch() ​

fetch: (req, env, ctx) => Promise<Response>

Defined in: src/applications.ts:223

Parameters ​

req ​

Request

env ​

E

ctx ​

ExecutionContext

Returns ​

Promise<Response>


tags ​

tags: string[]

Defined in: src/routing.ts:340

Inherited from ​

Router.tags


deprecated ​

deprecated: boolean

Defined in: src/routing.ts:341

Inherited from ​

Router.deprecated


includeInSchema ​

includeInSchema: boolean

Defined in: src/routing.ts:342

Inherited from ​

Router.includeInSchema


responses ​

responses: Record<number, ResponseConfig>

Defined in: src/routing.ts:343

Inherited from ​

Router.responses


defaultResponseClass ​

defaultResponseClass: ResponseClass

Defined in: src/routing.ts:345

Inherited from ​

Router.defaultResponseClass


routeMatcher ​

routeMatcher: RouteMatcher<E>

Defined in: src/routing.ts:347

Inherited from ​

Router.routeMatcher

Methods ​

include() ​

include(pathPrefix, router): void

Defined in: src/applications.ts:121

Parameters ​

pathPrefix ​

string

router ​

Router<E>

Returns ​

void


openapi() ​

openapi(): OpenAPIObject

Defined in: src/applications.ts:132

Returns ​

OpenAPIObject


handle() ​

handle(baseArgs): Promise<Response>

Defined in: src/applications.ts:158

Parameters ​

baseArgs ​

ArgsOf<{ }, E>

Returns ​

Promise<Response>


get() ​

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

Defined in: src/routing.ts:381

Type Parameters ​

R ​

R

Ps ​

Ps extends RouteParameters

Parameters ​

path ​

string

unboundRoute ​

UnboundRoute<R, Ps, E>

Returns ​

Route<R, Ps, E>

Inherited from ​

Router.get


post() ​

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

Defined in: src/routing.ts:387

Type Parameters ​

R ​

R

Ps ​

Ps extends RouteParameters

Parameters ​

path ​

string

unboundRoute ​

UnboundRoute<R, Ps, E>

Returns ​

Route<R, Ps, E>

Inherited from ​

Router.post


put() ​

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

Defined in: src/routing.ts:393

Type Parameters ​

R ​

R

Ps ​

Ps extends RouteParameters

Parameters ​

path ​

string

unboundRoute ​

UnboundRoute<R, Ps, E>

Returns ​

Route<R, Ps, E>

Inherited from ​

Router.put


delete() ​

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

Defined in: src/routing.ts:399

Type Parameters ​

R ​

R

Ps ​

Ps extends RouteParameters

Parameters ​

path ​

string

unboundRoute ​

UnboundRoute<R, Ps, E>

Returns ​

Route<R, Ps, E>

Inherited from ​

Router.delete


patch() ​

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

Defined in: src/routing.ts:405

Type Parameters ​

R ​

R

Ps ​

Ps extends RouteParameters

Parameters ​

path ​

string

unboundRoute ​

UnboundRoute<R, Ps, E>

Returns ​

Route<R, Ps, E>

Inherited from ​

Router.patch


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

Defined in: src/routing.ts:411

Type Parameters ​

R ​

R

Ps ​

Ps extends RouteParameters

Parameters ​

path ​

string

unboundRoute ​

UnboundRoute<R, Ps, E>

Returns ​

Route<R, Ps, E>

Inherited from ​

Router.head


trace() ​

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

Defined in: src/routing.ts:417

Type Parameters ​

R ​

R

Ps ​

Ps extends RouteParameters

Parameters ​

path ​

string

unboundRoute ​

UnboundRoute<R, Ps, E>

Returns ​

Route<R, Ps, E>

Inherited from ​

Router.trace


options() ​

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

Defined in: src/routing.ts:423

Type Parameters ​

R ​

R

Ps ​

Ps extends RouteParameters

Parameters ​

path ​

string

unboundRoute ​

UnboundRoute<R, Ps, E>

Returns ​

Route<R, Ps, E>

Inherited from ​

Router.options


route() ​

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

Defined in: src/routing.ts:430

Type Parameters ​

R ​

R

Ps ​

Ps extends RouteParameters

Parameters ​

method ​

HTTPMethod

path ​

string

unboundRoute ​

UnboundRoute<R, Ps, E>

Returns ​

Route<R, Ps, E>

Inherited from ​

Router.route