deno.land / x / abc@v1.3.3 / docs / cors.md

CORS

CORS is a mechanism that allows resources to be requested from another domain, which enable secure cross-domain data transfers.

Usage

const config: CORSConfig = {
  allowOrigins: ["https://a.com", "https://b.com", "https://c.com"],
  allowMethods: [HttpMethod.Get],
};
const app = new Application();
app.use(cors(config));

Default Configuration

export const DefaultCORSConfig: CORSConfig = {
  skipper: DefaultSkipper,
  allowOrigins: ["*"],
  allowMethods: [
    HttpMethod.Delete,
    HttpMethod.Get,
    HttpMethod.Head,
    HttpMethod.Patch,
    HttpMethod.Post,
    HttpMethod.Put,
  ],
};
abc

Version Info

Tagged at
2 years ago