Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amio/micro-cors

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amio/micro-cors

Simple CORS middleware for Zeit's Micro

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

micro-cors

Build Status

Simple CORS middleware for Zeit's Micro

Install

npm install @amio/micro-cors

Usage

Basic

const micro = require('micro')
const cors = require('micro-cors')

const handler = (req, res) => micro.send(res, 200, 'ok!')

module.exports = cors()(handler)

With options

const micro = require('micro')
const cors = require('micro-cors')

const options = { allowMethods: 'PUT,POST' }
const handler = (req, res) => micro.send(res, 200, 'ok!')

module.exports = cors(options)(handler)

Options

allowMethods <String>

default: 'HEAD,GET,POST,PUT,PATCH,DELETE,OPTIONS'

allowHeaders <String>

default: 'X-Requested-With,Access-Control-Allow-Origin,X-HTTP-Method-Override,Content-Type,Authorization,Accept'

exposeHeaders <String>

default: undefined

maxAge <String>

default: 86400

origin <String>

default: *

FAQs

Package last updated on 16 Jun 2018

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