Skip to main content

Class: abstract Route<Options>

Since

1.0.0

Extends

  • Piece<Options, "routes">

Type parameters

Type parameterValue
Options extends OptionsOptions

Constructors

new Route()

new Route<Options>(context: LoaderContext, options: Options): Route<Options>

Parameters

ParameterType
contextLoaderContext
optionsOptions

Returns

Route<Options>

Overrides

Piece<Options, 'routes'>.constructor

Source

projects/plugins/packages/api/src/lib/structures/Route.ts:33

Properties

acceptedContentMimeTypes

readonly acceptedContentMimeTypes: null | readonly (`message/${string}` | `audio/${string}` | `video/${string}` | `image/${string}` | `text/${string}` | `application/${string}` | `multipart/${string}` | `X-${string}/${string}`)[]

The accepted content types.

Source

projects/plugins/packages/api/src/lib/structures/Route.ts:21


maximumBodyLength

readonly maximumBodyLength: number

(RFC 7230 3.3.2) The maximum decimal number of octets.

Source

projects/plugins/packages/api/src/lib/structures/Route.ts:16


methods

readonly methods: Collection <Methods, MethodCallback>

The methods this route accepts.

Source

projects/plugins/packages/api/src/lib/structures/Route.ts:31


router

readonly router: RouteData

The route information.

Source

projects/plugins/packages/api/src/lib/structures/Route.ts:26

Methods

onLoad()

onLoad(): unknown

Per-piece listener that is called when the piece is loaded into the store. Useful to set-up asynchronous initialization tasks.

Returns

unknown

Overrides

Piece.onLoad

Source

projects/plugins/packages/api/src/lib/structures/Route.ts:52


onUnload()

onUnload(): unknown

Per-piece listener that is called when the piece is unloaded from the store. Useful to set-up clean-up tasks.

Returns

unknown

Overrides

Piece.onUnload

Source

projects/plugins/packages/api/src/lib/structures/Route.ts:66