Skip to content

Taxum / @taxum/core / middleware/cors / AllowMethods

Class: AllowMethods

Defined in: middleware/cors/allow-methods.ts:11

Holds configuration for how to set the Access-Control-Allow-Methods header.

See

Methods

any()

static any(): AllowMethods

Defined in: middleware/cors/allow-methods.ts:56

Allows any methods by sending a wildcard (*).

Returns

AllowMethods


default()

static default(): AllowMethods

Defined in: middleware/cors/allow-methods.ts:18

Returns

AllowMethods


exact()

static exact(method): AllowMethods

Defined in: middleware/cors/allow-methods.ts:63

Sets a single allowed method.

Parameters

method

string | Method

Returns

AllowMethods


from()

static from(like): AllowMethods

Defined in: middleware/cors/allow-methods.ts:22

Parameters

like

AllowMethodsLike

Returns

AllowMethods


list()

static list(methods): AllowMethods

Defined in: middleware/cors/allow-methods.ts:70

Sets multiple allowed methods.

Parameters

methods

(string | Method)[]

Returns

AllowMethods


mirrorRequest()

static mirrorRequest(): AllowMethods

Defined in: middleware/cors/allow-methods.ts:77

Allow any methods by mirroring the preflight Access-Control-Request-Method header.

Returns

AllowMethods


none()

static none(): AllowMethods

Defined in: middleware/cors/allow-methods.ts:49

Allows no methods.

Returns

AllowMethods