New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@curveball/cors

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@curveball/cors

CORS middleware for curveball

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
402
increased by34%
Maintainers
4
Weekly downloads
 
Created
Source

Curveball CORS middleware

This package is a middleware for the Curveball framework.

Installation

npm install @curveball/cors 

Getting started

After installing the NPM package, simply import the CORS middleware to an existing Curveball server:

import cors from '@curveball/cors';
import { Application } from '@curveball/core';

const app = new Application();
app.use(cors());

When manually providing CORS options, this is how it should look:

app.use(cors({
    allowOrigin: '*',
    allowHeaders: ['Content-Type', 'Accept'],
    allowMethods: ['GET', 'POST'],
    exposeHeaders: ['Link', 'Date'],
    credentials: true
}));

If no options are given, it will use these defaults:

{
    allowOrigin: '*',
    allowHeaders: ['Content-Type', 'User-Agent', 'Authorization', 'Accept', 'Prefer', 'Prefer-Push', 'Link'],
    allowMethods: ['DELETE', 'GET', 'PATCH', 'POST', 'PUT'],
    exposeHeaders: ['Location', 'Link'],
    credentials: false
}

Keywords

FAQs

Package last updated on 20 Jan 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc