Skip to content

Workery / applications / App

Class: App<E>

applications.App

Type parameters

NameType
Eunknown

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

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

Type parameters

NameType
Eunknown

Parameters

NameType
initObject
init.rootPath?string
init.title?string
init.description?string
init.version?string
init.tagsInfo?TagObject[]
init.servers?ServerObject[]
init.contact?ContactObject
init.license?LicenseObject
init.termsOfService?string
init.openapiUrl?null | string
init.swaggerUrl?null | string
init.redocUrl?null | string
init.middleware?Middleware<E>[]
init.exceptionHandler?ExceptionHandler<E>
init.tags?string[]
init.deprecated?boolean
init.includeInSchema?boolean
init.responses?Record<number, ResponseConfig>
init.defaultResponseClass?ResponseClass

Returns

App<E>

Overrides

Router.constructor

Defined in

src/applications.ts:40

Properties

rootPath

rootPath: string

Defined in

src/applications.ts:23


title

title: string

Defined in

src/applications.ts:24


description

description: string

Defined in

src/applications.ts:25


version

version: string

Defined in

src/applications.ts:26


tagsInfo

tagsInfo: TagObject[]

Defined in

src/applications.ts:27


servers

Optional servers: ServerObject[]

Defined in

src/applications.ts:28


contact

Optional contact: ContactObject

Defined in

src/applications.ts:29


license

Optional license: LicenseObject

Defined in

src/applications.ts:30


termsOfService

Optional termsOfService: string

Defined in

src/applications.ts:31


openapiUrl

openapiUrl: null | string

Defined in

src/applications.ts:32


swaggerUrl

swaggerUrl: null | string

Defined in

src/applications.ts:33


redocUrl

redocUrl: null | string

Defined in

src/applications.ts:34


middleware

middleware: Middleware<E>[]

Defined in

src/applications.ts:35


exceptionHandler

exceptionHandler: ExceptionHandler<E>

Defined in

src/applications.ts:36


fetch

fetch: (req: Request<unknown, CfProperties<unknown>>, env: E, ctx: ExecutionContext) => Promise<Response>

Type declaration

▸ (req, env, ctx): Promise<Response>

Parameters
NameType
reqRequest<unknown, CfProperties<unknown>>
envE
ctxExecutionContext
Returns

Promise<Response>

Defined in

src/applications.ts:197


tags

tags: string[]

Inherited from

Router.tags

Defined in

src/routing.ts:265


deprecated

deprecated: boolean

Inherited from

Router.deprecated

Defined in

src/routing.ts:266


includeInSchema

includeInSchema: boolean

Inherited from

Router.includeInSchema

Defined in

src/routing.ts:267


responses

responses: Record<number, ResponseConfig>

Inherited from

Router.responses

Defined in

src/routing.ts:268


defaultResponseClass

defaultResponseClass: ResponseClass

Inherited from

Router.defaultResponseClass

Defined in

src/routing.ts:269


routeMatcher

routeMatcher: RouteMatcher<E>

Inherited from

Router.routeMatcher

Defined in

src/routing.ts:270

Methods

include

include(pathPrefix, router): void

Parameters

NameType
pathPrefixstring
routerRouter<E>

Returns

void

Defined in

src/applications.ts:108


openapi

openapi(): OpenAPIObject

Returns

OpenAPIObject

Defined in

src/applications.ts:115


handle

handle(baseArgs): Promise<Response>

Parameters

NameType
baseArgsArgsOf<{}, E>

Returns

Promise<Response>

Defined in

src/applications.ts:138


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>

Inherited from

Router.get

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>

Inherited from

Router.post

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>

Inherited from

Router.put

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>

Inherited from

Router.delete

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>

Inherited from

Router.patch

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>

Inherited from

Router.head

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>

Inherited from

Router.trace

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>

Inherited from

Router.options

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>

Inherited from

Router.route

Defined in

src/routing.ts:349