Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno_nest/modules/cors/mod.ts>CorsOptions

Refer to nestjs to realize some common functions for Deno, support hono and oak
Go to Latest
interface CorsOptions
Re-export
import { type CorsOptions } from "https://deno.land/x/deno_nest@v3.5.1/modules/cors/mod.ts";

Interface describing CORS options that can be set.

Properties

optional
origin: StaticOrigin | CustomOrigin

Configures the Access-Control-Allow-Origins CORS header. See here for more detail.

optional
methods: string | string[]

Configures the Access-Control-Allow-Methods CORS header.

optional
allowedHeaders: string | string[]

Configures the Access-Control-Allow-Headers CORS header.

optional
exposedHeaders: string | string[]

Configures the Access-Control-Expose-Headers CORS header.

optional
credentials: boolean

Configures the Access-Control-Allow-Credentials CORS header.

optional
maxAge: number

Configures the Access-Control-Max-Age CORS header.

optional
preflightContinue: boolean

Whether to pass the CORS preflight response to the next handler.

optional
optionsSuccessStatus: number

Provides a status code to use for successful OPTIONS requests.