expressjs/cors

Node.js CORS middleware

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 44 minutes ago
Added to GitGenius on September 10th, 2026
Created on January 31st, 2013
Open Issues & Pull Requests: 51 (+0)
GitHub issues: Enabled
Number of forks: 511
Total Stargazers: 6,194 (+0)
Total Subscribers: 80 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 12.5 hours
Mean response time: 98.2 days
90th percentile: 261.6 days
Tracked items: 39

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 4% of issues opened in the past year have been closed. Three people close 63% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 16
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,067 days
Stale 30+ days: 16
Stale 90+ days: 11

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • awaiting more info (7)
  • question (7)
  • bug (6)
  • help wanted (5)
  • docs (4)
  • 3.x (3)
  • enhancement (2)
  • ideas (2)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

cors is a Node.js middleware for Express and Connect that sets CORS response headers to control which origins can read responses from your server.

The middleware addresses the need to enable cross-origin requests in web applications by setting the appropriate HTTP response headers that browsers use to enforce CORS policy. It clarifies an important distinction: the middleware sets headers but does not block requests—CORS enforcement happens in the browser itself. Non-browser clients like curl, Postman, or server-to-server requests ignore CORS headers entirely. The tool supports both simple and complex CORS scenarios, including pre-flight OPTIONS requests for requests using non-standard HTTP verbs or custom headers.

Developers should choose this middleware if they are building Express or Connect applications that need to serve requests from different origins. It suits any API or web service where browser-based clients need to access resources across domain boundaries. The middleware offers flexible configuration through static options, dynamic origin validation via callback functions, and per-request customization. Dynamic origin validation enables loading allowed origins from a database or other backing datasource, making it suitable for applications with complex access control requirements.

The project maintains active engagement with its user base through documentation that addresses common misconceptions about how CORS works. The README includes detailed configuration options and multiple usage patterns ranging from enabling all CORS requests globally to configuring specific routes with custom settings. The documentation emphasizes the distinction between what the middleware does—setting headers—and what browsers do with those headers, helping developers avoid misunderstanding CORS behavior.