CORS middleware for fetch-based router.
npm install @borderless/fetch-cors --save
import { compose } from "throwback";
import { cors } from "@borderless/fetch-cors";
import { get } from "@borderless/fetch-router";
const app = compose([cors(), get("/test", () => new Response("hello world"))]);
This project is written using TypeScript and publishes the definitions directly to NPM.
MIT