Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

cors

import { cors } from "https://raw.githubusercontent.com/worker-tools/shed/master/index.ts";

A CORS middleware that gives clients exactly the permissions they ask for, unless constrained by the definitions in options.

Note that applying this middleware to your routes isn't enough for non-GET requests. Pre-flight/OPTIONS routes need to be added manually:

router.options('/your/path', anyCORS(), () => noContent())
router.post('/your/path', anyCORS(), (req, {}) => ok())
const cors: (options?: CORSOptions) => unknown;