CorsOptionsBuilder
Esta página aún no está disponible en tu idioma.
Defined in: src/http/middleware/CorsOptions.ts:32
Fluent builder for CorsOptionsType.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CorsOptionsBuilder():
CorsOptionsBuilder
Returns
Section titled “Returns”CorsOptionsBuilder
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”build()
Section titled “build()”build():
Partial<T>
Defined in: src/util/OptionsBuilder.ts:51
Snapshot the set fields as an independent Partial<T> (own props only).
Returns
Section titled “Returns”Partial<T>
Inherited from
Section titled “Inherited from”withAllowedHeaders()
Section titled “withAllowedHeaders()”withAllowedHeaders(…
headers):this
Defined in: src/http/middleware/CorsOptions.ts:51
Parameters
Section titled “Parameters”headers
Section titled “headers”…string[]
Returns
Section titled “Returns”this
withAnyOrigin()
Section titled “withAnyOrigin()”withAnyOrigin():
this
Defined in: src/http/middleware/CorsOptions.ts:41
Allow any origin (*). Must be explicit — no accidental wildcard.
Returns
Section titled “Returns”this
withCredentials()
Section titled “withCredentials()”withCredentials(
flag?):this
Defined in: src/http/middleware/CorsOptions.ts:57
Parameters
Section titled “Parameters”boolean = true
Returns
Section titled “Returns”this
withExposedHeaders()
Section titled “withExposedHeaders()”withExposedHeaders(…
headers):this
Defined in: src/http/middleware/CorsOptions.ts:54
Parameters
Section titled “Parameters”headers
Section titled “headers”…string[]
Returns
Section titled “Returns”this
withMaxAge()
Section titled “withMaxAge()”withMaxAge(
seconds):this
Defined in: src/http/middleware/CorsOptions.ts:60
Parameters
Section titled “Parameters”seconds
Section titled “seconds”number
Returns
Section titled “Returns”this
withMethods()
Section titled “withMethods()”withMethods(…
methods):this
Defined in: src/http/middleware/CorsOptions.ts:48
Parameters
Section titled “Parameters”methods
Section titled “methods”…HttpMethod[]
Returns
Section titled “Returns”this
withOriginPredicate()
Section titled “withOriginPredicate()”withOriginPredicate(
predicate):this
Defined in: src/http/middleware/CorsOptions.ts:45
Decide per request; a throwing predicate denies.
Parameters
Section titled “Parameters”predicate
Section titled “predicate”(origin) => boolean
Returns
Section titled “Returns”this
withOrigins()
Section titled “withOrigins()”withOrigins(…
origins):this
Defined in: src/http/middleware/CorsOptions.ts:37
Exact-match origin allowlist.
Parameters
Section titled “Parameters”origins
Section titled “origins”…string[]
Returns
Section titled “Returns”this
create()
Section titled “create()”
staticcreate():CorsOptionsBuilder
Defined in: src/http/middleware/CorsOptions.ts:33
Returns
Section titled “Returns”CorsOptionsBuilder
