# cyu/rack-cors

Rack Middleware for handling Cross-Origin Resource Sharing (CORS), which makes cross-origin AJAX possible.

Repository: https://github.com/cyu/rack-cors
Canonical: https://ross.abutalabs.com/products/rack-cors
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2025-05-16T17:59:04+00:00

## Health v2 (maintenance only)
Score: 42/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 21, release rhythm 35, longevity 100
- inputs: {"age_days": 5936, "days_push": 474, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3290, forks 258 (observed 2026-08-28T04:07:53.922588+00:00)

## What it is
Rack middleware that adds Cross-Origin Resource Sharing (CORS) support to Rack-compatible Ruby web applications, including Rails. It lets you declaratively configure allowed origins, headers, and HTTP methods so browsers can make cross-domain AJAX requests.

## Use cases
- enable CORS for a Rails API
- allow cross-origin AJAX requests in a Rack app
- configure allowed origins and headers for browser requests
- replace JSONP workarounds with proper CORS headers
- restrict API access to specific domains
- handle preflight OPTIONS requests in Ruby web apps

## When to choose
- you run a Rack-based app (Rails, Sinatra) that a browser frontend on another origin consumes
- you need fine-grained per-resource CORS rules with regex origins and exposed headers
- you want the standard, widely-used CORS solution in the Ruby ecosystem

## When to avoid
- your server is not Rack-based (e.g., Node, Go, nginx-only setups)
- you need CORS handled at the proxy/CDN layer rather than in app middleware
- you only serve same-origin requests and need no cross-origin access

## Facets
- artifact type: library
- maturity: active
- function: middleware, http-server, security, web-framework
- domain: web-development, backend, apis, security
- platform: ruby, cross-platform
- tags: cors, rack, rails, ruby-gem, cross-origin, web-server

## Member repositories
- cyu/rack-cors (main) score 42

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:53.922588+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-29T18:43:12.271356+00:00, confidence not recorded.
  - readme: https://github.com/cyu/rack-cors (fetched 2026-08-28T04:07:53.922588+00:00, sha 4caa45c187f9)
- Data as of 2026-08-30T08:39:29.467469+00:00.
