CORS middleware for Koa (v0.0.16). Inspired by node-cors, this middleware adds Cross-Origin Resource Sharing (CORS) headers to Koa responses. It supports all standard CORS options: origin, expose, maxAge, credentials, methods, and headers. It is a simple, lightweight solution for enabling CORS in Koa apps, but note that the package is old and the Koa ecosystem has evolved significantly since v1. Unmaintained since 2016; consider using @koa/cors for modern Koa 2.x.
npm install koa-corsVerified import paths — ran on the pinned version, not inferred.
Shows basic Koa app with CORS enabled reflecting request origin.
Use @koa/cors instead, which supports Koa 2.x.
Migrate to active alternatives like @koa/cors or koa2-cors.
Use @koa/cors or wrap with koa-convert: const convert = require('koa-convert'); app.use(convert(cors()));No dependency data recorded yet.