Skip to main content

Interface: RouteOptions

@sapphire/plugin-api.RouteOptions

Hierarchy

  • Options

    โ†ณ RouteOptions

Properties

acceptedContentMimeTypes

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

The accepted content types for this route. If set to null, the route will accept any data.

since 1.3.0

default this.context.server.options.acceptedContentMimeTypes ?? null

Defined in

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


enabled

โ€ข Optional Readonly enabled: boolean

Whether or not the piece should be enabled. If set to false, the piece will be unloaded.

default true

Inherited from

Piece.Options.enabled

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:417


maximumBodyLength

โ€ข Optional maximumBodyLength: number

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

since 1.0.0

default this.context.server.options.maximumBodyLength ?? 1024 1024 50

Defined in

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


name

โ€ข Optional Readonly name: string

The name for the piece.

default ''

Inherited from

Piece.Options.name

Defined in

node_modules/@sapphire/pieces/dist/index.d.ts:412


route

โ€ข Optional route: string

The route the piece should represent.

since 1.0.0

default ''

example

'/users'
// request.params -> {}

example

'/guilds/:guild/members/:member/'
// request.params -> { guild: '...', member: '...' }

Defined in

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