{"repo":"expressjs/cors","free":true,"listed":false,"github":"https://github.com/expressjs/cors","clone":"git clone https://github.com/expressjs/cors.git","description":"Node.js CORS middleware","language":"JavaScript","stars":6189,"topics":["javascript","nodejs","expressjs","middleware","cors"],"license":"MIT","category":"dev-tools","readme_excerpt":"cors [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Build Status][github-actions-ci-image]][github-actions-ci-url] [![Test Coverage][coveralls-image]][coveralls-url] CORS is a Node.js middleware for Express/Connect that sets CORS response headers. These headers tell browsers which origins can read responses from your server. [!IMPORTANT] How CORS Works: This package sets response headers—it doesn't block requests. CORS is enforced by browsers: they check the headers and decide if JavaScript can read the response. Non-browser clients (curl, Postman, other servers) ignore CORS entirely. See the MDN CORS guide for details. Installation Usage Simple Usage Enable CORS for a Single Route Configuring CORS Configuring CORS w/ Dynamic Origin Enabling CORS Pre-Flight Customizing CORS Settings Dynamically per Request Configuration Options Common Misconceptions License Original Author Installation This is a Node.js module available through the npm registry. Installation is done using the npm install command: Usage Simple Usage (Enable All CORS Requests) Enable CORS for a Single Route Configuring CORS See the configuration options for details. Configuring CORS w/ Dynamic Origin This module supports validating the origin dynamically using a function provided to the origin option. This function will be passed a string that is the origin (or undefined if the request has no origin), and a callback with the signature callback(error, origin) . The ori","default_branch":null,"files":null,"tree":[],"storefront":"/r/expressjs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/expressjs/cors/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}