🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

cors-magic

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cors-magic

A customizable CORS middleware for Express.js.

1.0.0
latest
Source
npm
Version published
Maintainers
0
Created
Source

cors-magic

A customizable CORS middleware for Express.js applications.

Installation

npm install cors-magic

Usage

const express = require('express');
const cors = require('cors-magic');

const app = express();

// Default configuration
app.use(cors());

// Custom configuration
app.use(cors({
  origins: ['https://example.com', 'https://anotherdomain.com'],
  methods: ['GET', 'POST'],
  headers: ['Content-Type', 'Authorization'],
  allowCredentials: true
}));

app.listen(3000, () => {
  console.log('Server running on port 3000');
});

Keywords

cors

FAQs

Package last updated on 03 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts