oak_cors

Deno

Forked from the nodejs package expressjs cors. Now it is just a simple and opinionated cors middleware for Deno oak.

Example

import { CORS } from "https://deno.land/x/oak_cors@v0.1.1/mod.ts";
import { Application } from "https://deno.land/x/oak/mod.ts";

const app = new Application();
app.use(CORS());

// other middleware

await app.listen(":80");

If you use the default options, it will work as both origin: true and credentials: true.