콘텐츠로 이동
한국어

CorsOptionsBuilder

이 콘텐츠는 아직 번역되지 않았습니다.

Defined in: src/http/middleware/CorsOptions.ts:32

Fluent builder for CorsOptionsType.

new CorsOptionsBuilder(): CorsOptionsBuilder

CorsOptionsBuilder

OptionsBuilder.constructor

build(): Partial<T>

Defined in: src/util/OptionsBuilder.ts:51

Snapshot the set fields as an independent Partial<T> (own props only).

Partial<T>

OptionsBuilder.build


withAllowedHeaders(…headers): this

Defined in: src/http/middleware/CorsOptions.ts:51

string[]

this


withAnyOrigin(): this

Defined in: src/http/middleware/CorsOptions.ts:41

Allow any origin (*). Must be explicit — no accidental wildcard.

this


withCredentials(flag?): this

Defined in: src/http/middleware/CorsOptions.ts:57

boolean = true

this


withExposedHeaders(…headers): this

Defined in: src/http/middleware/CorsOptions.ts:54

string[]

this


withMaxAge(seconds): this

Defined in: src/http/middleware/CorsOptions.ts:60

number

this


withMethods(…methods): this

Defined in: src/http/middleware/CorsOptions.ts:48

HttpMethod[]

this


withOriginPredicate(predicate): this

Defined in: src/http/middleware/CorsOptions.ts:45

Decide per request; a throwing predicate denies.

(origin) => boolean

this


withOrigins(…origins): this

Defined in: src/http/middleware/CorsOptions.ts:37

Exact-match origin allowlist.

string[]

this


static create(): CorsOptionsBuilder

Defined in: src/http/middleware/CorsOptions.ts:33

CorsOptionsBuilder