# expressjs/cors

Node.js CORS middleware

Repository: https://github.com/expressjs/cors
Canonical: https://ross.abutalabs.com/products/cors
Language: JavaScript
License: MIT
License Family: permissive
Topics: javascript, nodejs, expressjs, middleware, cors
Last push: 2026-06-02T20:00:40+00:00

## Health v2 (maintenance only)
Score: 70/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 85, release rhythm 35, longevity 100
- inputs: {"age_days": 4962, "days_push": 92, "days_rel": 223, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6191, forks 511 (observed 2026-08-28T04:09:39.138841+00:00)

## What it is
A Node.js middleware for Express and Connect that sets CORS response headers, telling browsers which origins may read responses from your server. It supports simple usage, per-route enabling, dynamic origin configuration, and pre-flight handling.

## Use cases
- enable cross-origin requests to my express api
- allow a browser frontend to call my nodejs server
- configure allowed origins for cors headers
- handle cors pre-flight options requests
- enable cors for a single route in express
- set dynamic origin per request in nodejs

## When to choose
- you run an Express or Connect server and need browser cross-origin access
- you want configurable, per-route or dynamic CORS header handling
- you need a small, battle-tested middleware with simple npm install

## When to avoid
- your server is not Node.js/Express/Connect
- you expect CORS to block requests - it only sets headers enforced by browsers
- non-browser clients are your only consumers, since they ignore CORS entirely

## Facets
- artifact type: library
- maturity: stable
- function: middleware, http-server, security, web-framework
- domain: web-development, backend, apis, security
- platform: -
- tags: cors, express, connect, cross-origin-resource-sharing, http-headers, pre-flight, nodejs, web-server

## Member repositories
- expressjs/cors (main) score 70

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:39.138841+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:47:22.202357+00:00, confidence not recorded.
  - readme: https://github.com/expressjs/cors (fetched 2026-08-28T04:09:39.138841+00:00, sha 904d8c990c73)
  - registry_npm: https://registry.npmjs.org/cors (fetched 2026-08-29T08:44:05.214607+00:00, sha a4cd5738f327)
- Data as of 2026-08-30T08:39:29.467469+00:00.
