micro-helmet
security headers for micro
Last updated 5 months ago by goto-bus-stop .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install micro-helmet 
SYNC missed versions from official npm registry.

micro-helmet

security headers for micro using helmet

requires node.js 10+

Install - Usage - License: Apache-2.0

npm travis standard

Install

npm install micro-helmet

Usage

As a wrapper function:

var helmet = require('micro-helmet')

module.exports = helmet(async (req, res) => {
  return { ok: true }
})

As a utility:

var helmet = require('micro-helmet')

module.exports = async (req, res) => {
  await helmet.addHeaders(req, res)
  return { ok: true }
}

API

helmet(handler, opts={})

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.

await helmet.addHeaders(req, res, opts={})

Add helmet's headers. opts can be used to configure specific headers. It is passed through to helmet.

License

Apache-2.0

Current Tags

  • 2.0.0                                ...           latest (5 months ago)

3 Versions

  • 2.0.0                                ...           5 months ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |