security headers for micro
npm install micro-helmetsecurity headers for micro using helmet
requires node.js 10+
Install - Usage - License: Apache-2.0
[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url]
[![standard][standard-image]][standard-url]
[npm-image]: https://img.shields.io/npm/v/micro-helmet.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/micro-helmet
[travis-image]: https://img.shields.io/travis/com/goto-bus-stop/micro-helmet.svg?style=flat-square
[travis-url]: https://travis-ci.com/goto-bus-stop/micro-helmet
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/standard
```
npm install micro-helmet
As a wrapper function:
`js
var helmet = require('micro-helmet')
module.exports = helmet(async (req, res) => {
return { ok: true }
})
`
As a utility:
`js
var helmet = require('micro-helmet')
module.exports = async (req, res) => {
await helmet.addHeaders(req, res)
return { ok: true }
}
`
Wrap a handler function. This adds helmet's headers before calling your handler.
opts can be used to configure specific headers. It is passed through to helmet.
Add helmet's headers.
opts` can be used to configure specific headers. It is passed through to helmet.