Miss any of our Open RFC calls?Watch the recordings here! »

fastify-helmet

5.0.3 • Public • Published

fastify-helmet

js-standard-style CIworkflow

Important security headers for Fastify. It is a tiny wrapper around helmet.

Install

npm i fastify-helmet

Usage

Simply require this plugin, and the basic security headers will be set.

const fastify = require('fastify')()
const helmet = require('fastify-helmet')
 
fastify.register(
  helmet,
  // Example of passing an option to x-powered-by middleware
  { hidePoweredBy: { setTo: 'PHP 4.2.0' } }
)
 
fastify.listen(3000, err => {
  if (err) throw err
})

How it works

fastify-helmet is just a tiny wrapper around helmet that adds an 'onRequest' hook. It accepts the same options of Helmet, and you can see more in the helmet documentation.

License

MIT

Install

npm i fastify-helmet

DownloadsWeekly Downloads

13,202

Version

5.0.3

License

MIT

Unpacked Size

9.79 kB

Total Files

12

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar