A lightweight middleware for Express.js (versions 0.x to 3.x) that enables Cross-Origin Resource Sharing (CORS) by adding appropriate HTTP headers. Version 0.0.3 is the latest and final release; the package has been abandoned in favor of the more popular 'cors' package. It allows configuration of allowed origins with flexible patterns (including scheme, subdomain, and port wildcards), as well as custom methods, headers, and max age. No longer maintained and incompatible with Express 4+ due to internal API changes and missing CORS preflight handling for non-simple requests.
npm install express-corsVerified import paths — ran on the pinned version, not inferred.
Set up Express middleware to allow CORS from example.com and subdomains, with custom methods and headers.
Replace with 'cors' package: npm uninstall express-cors && npm install cors
Migrate to cors package which supports Express 4+.
Add a separate OPTIONS route or use cors package which handles preflight automatically.
Use '*' as an origin string if needed, but note that this package's pattern matching may behave unexpectedly.
Use require('express-cors') instead: const cors = require('express-cors');Ensure you pass the options object to cors(): app.use(cors({ ... }))Run: npm install express-cors
No dependency data recorded yet.