Skip to main content

Helmet for Express - Setting up Security for Your Web Application

Helmet for Express is commonly used for setting up Security for Your Web Application. It is group of middleware for security.

HOW TO INSTALL?

Install Helmet and Express using Node Package Manager (NPM)
npm install --save express
npm install --save helmet

HOW TO INCLUDE?

Include Helmet and Express in your application in the following way in the main app.js/server.js
const express = require('express');
const helmet = require('helmet');

HOW TO USE?

Finally use it as a middleware right after creating express instance.
const app = express();
app.use(helmet());

That's it folks, you are set!

Comments