Workery / applications / App
Class: App<E>
applications.App
Type parameters
Name | Type |
---|---|
E | unknown |
Hierarchy
Router
<E
>↳
App
Table of contents
Constructors
Properties
- rootPath
- title
- description
- version
- tagsInfo
- servers
- contact
- license
- termsOfService
- openapiUrl
- swaggerUrl
- redocUrl
- middleware
- exceptionHandler
- fetch
- tags
- deprecated
- includeInSchema
- responses
- defaultResponseClass
- routeMatcher
Methods
Constructors
constructor
• new App<E
>(init
): App
<E
>
Type parameters
Name | Type |
---|---|
E | unknown |
Parameters
Name | Type |
---|---|
init | Object |
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
Defined in
Properties
rootPath
• rootPath: string
Defined in
title
• title: string
Defined in
description
• description: string
Defined in
version
• version: string
Defined in
tagsInfo
• tagsInfo: TagObject
[]
Defined in
servers
• Optional
servers: ServerObject
[]
Defined in
contact
• Optional
contact: ContactObject
Defined in
license
• Optional
license: LicenseObject
Defined in
termsOfService
• Optional
termsOfService: string
Defined in
openapiUrl
• openapiUrl: null
| string
Defined in
swaggerUrl
• swaggerUrl: null
| string
Defined in
redocUrl
• redocUrl: null
| string
Defined in
middleware
• middleware: Middleware
<E
>[]
Defined in
exceptionHandler
• exceptionHandler: ExceptionHandler
<E
>
Defined in
fetch
• fetch: (req
: Request
<unknown
, CfProperties
<unknown
>>, env
: E
, ctx
: ExecutionContext
) => Promise
<Response
>
Type declaration
▸ (req
, env
, ctx
): Promise
<Response
>
Parameters
Name | Type |
---|---|
req | Request <unknown , CfProperties <unknown >> |
env | E |
ctx | ExecutionContext |
Returns
Promise
<Response
>
Defined in
tags
• tags: string
[]
Inherited from
Defined in
deprecated
• deprecated: boolean
Inherited from
Defined in
includeInSchema
• includeInSchema: boolean
Inherited from
Defined in
responses
• responses: Record
<number
, ResponseConfig
>
Inherited from
Defined in
defaultResponseClass
• defaultResponseClass: ResponseClass
Inherited from
Defined in
routeMatcher
• routeMatcher: RouteMatcher
<E
>
Inherited from
Defined in
Methods
include
▸ include(pathPrefix
, router
): void
Parameters
Name | Type |
---|---|
pathPrefix | string |
router | Router <E > |
Returns
void
Defined in
openapi
▸ openapi(): OpenAPIObject
Returns
OpenAPIObject
Defined in
handle
▸ handle(baseArgs
): Promise
<Response
>
Parameters
Name | Type |
---|---|
baseArgs | ArgsOf <{}, E > |
Returns
Promise
<Response
>
Defined in
get
▸ get<R
, Ps
>(path
, unboundRoute
): Route
<R
, Ps
, E
>
Type parameters
Name | Type |
---|---|
R | R |
Ps | extends RouteParameters |
Parameters
Name | Type |
---|---|
path | string |
unboundRoute | UnboundRoute <R , Ps , E > |
Returns
Route
<R
, Ps
, E
>
Inherited from
Defined in
post
▸ post<R
, Ps
>(path
, unboundRoute
): Route
<R
, Ps
, E
>
Type parameters
Name | Type |
---|---|
R | R |
Ps | extends RouteParameters |
Parameters
Name | Type |
---|---|
path | string |
unboundRoute | UnboundRoute <R , Ps , E > |
Returns
Route
<R
, Ps
, E
>
Inherited from
Defined in
put
▸ put<R
, Ps
>(path
, unboundRoute
): Route
<R
, Ps
, E
>
Type parameters
Name | Type |
---|---|
R | R |
Ps | extends RouteParameters |
Parameters
Name | Type |
---|---|
path | string |
unboundRoute | UnboundRoute <R , Ps , E > |
Returns
Route
<R
, Ps
, E
>
Inherited from
Defined in
delete
▸ delete<R
, Ps
>(path
, unboundRoute
): Route
<R
, Ps
, E
>
Type parameters
Name | Type |
---|---|
R | R |
Ps | extends RouteParameters |
Parameters
Name | Type |
---|---|
path | string |
unboundRoute | UnboundRoute <R , Ps , E > |
Returns
Route
<R
, Ps
, E
>
Inherited from
Defined in
patch
▸ patch<R
, Ps
>(path
, unboundRoute
): Route
<R
, Ps
, E
>
Type parameters
Name | Type |
---|---|
R | R |
Ps | extends RouteParameters |
Parameters
Name | Type |
---|---|
path | string |
unboundRoute | UnboundRoute <R , Ps , E > |
Returns
Route
<R
, Ps
, E
>
Inherited from
Defined in
head
▸ head<R
, Ps
>(path
, unboundRoute
): Route
<R
, Ps
, E
>
Type parameters
Name | Type |
---|---|
R | R |
Ps | extends RouteParameters |
Parameters
Name | Type |
---|---|
path | string |
unboundRoute | UnboundRoute <R , Ps , E > |
Returns
Route
<R
, Ps
, E
>
Inherited from
Defined in
trace
▸ trace<R
, Ps
>(path
, unboundRoute
): Route
<R
, Ps
, E
>
Type parameters
Name | Type |
---|---|
R | R |
Ps | extends RouteParameters |
Parameters
Name | Type |
---|---|
path | string |
unboundRoute | UnboundRoute <R , Ps , E > |
Returns
Route
<R
, Ps
, E
>
Inherited from
Defined in
options
▸ options<R
, Ps
>(path
, unboundRoute
): Route
<R
, Ps
, E
>
Type parameters
Name | Type |
---|---|
R | R |
Ps | extends RouteParameters |
Parameters
Name | Type |
---|---|
path | string |
unboundRoute | UnboundRoute <R , Ps , E > |
Returns
Route
<R
, Ps
, E
>
Inherited from
Defined in
route
▸ route<R
, Ps
>(method
, path
, unboundRoute
): Route
<R
, Ps
, E
>
Type parameters
Name | Type |
---|---|
R | R |
Ps | extends RouteParameters |
Parameters
Name | Type |
---|---|
method | HTTPMethod |
path | string |
unboundRoute | UnboundRoute <R , Ps , E > |
Returns
Route
<R
, Ps
, E
>