Skip to main content

Interface: ServerOptions

@sapphire/plugin-api.ServerOptions

The API options.

since 1.0.0

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 null

Defined in

projects/plugins/packages/api/src/lib/structures/http/Server.ts:199


auth

โ€ข Optional auth: ServerOptionsAuth

The auth options. If neither auth nor auth.secret are defined, auth-related routes and middlewares will be automatically disabled.

since 1.0.0

default {}

Defined in

projects/plugins/packages/api/src/lib/structures/http/Server.ts:221


listenOptions

โ€ข Optional listenOptions: ListenOptions

The HTTP listen options.

since 1.0.0

default { port: 4000 }

Defined in

projects/plugins/packages/api/src/lib/structures/http/Server.ts:213


maximumBodyLength

โ€ข Optional maximumBodyLength: number

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

since 1.0.0

default 1024 1024 50

Defined in

projects/plugins/packages/api/src/lib/structures/http/Server.ts:192


origin

โ€ข Optional origin: string

The origin header to be set on every request at 'Access-Control-Allow-Origin'.

since 1.0.0

default '*'

Defined in

projects/plugins/packages/api/src/lib/structures/http/Server.ts:185


prefix

โ€ข Optional prefix: string

The prefix for all routes, e.g. v1/.

since 1.0.0

default ''

Defined in

projects/plugins/packages/api/src/lib/structures/http/Server.ts:178


server

โ€ข Optional server: ServerOptions

The HTTP server options.

since 1.0.0

default {}

Defined in

projects/plugins/packages/api/src/lib/structures/http/Server.ts:206