Socket
Book a DemoInstallSign in
Socket

micro-access

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-access

Easy CORS handling for micro

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

micro-access Build Status

Easy CORS handling for micro

Install

$ npm install micro-access

Usage

const {json, send} = require('micro');
const microAccess = require('micro-access');

module.exports = microAccess()(async (req, res) => {
	const body = await json(req);
	send(res, 200, body);
});

API

microAccess([options])(handler)

options

Type: Object

Same as control-access.

handler

Type: Function

The request handler to wrap.

  • control-access - Easy CORS handling

License

MIT © Kevin Mårtensson

Keywords

allow

FAQs

Package last updated on 30 Oct 2017

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