InterviewHubPRO
Section Overview
Q49

Question 49 of 60

Part 4: Express, Fastify, APIs & Middleware (36 - 50)

82%
Node.js & Libuv•Part 4: Express, Fastify, APIs & Middleware (36 - 50)

The role of `helmet` middleware.

In Simple Words: Sets critical HTTP security headers automatically: Content-Security-Policy, Strict-Transport-Security (HSTS), X-Frame-Options, X-Content-Type-Options, and removes X-Powered-By: Express.

javascript
const helmet = require('helmet');
app.use(helmet()); // Automatically sets 15+ secure HTTP headers