mw/helmet
Sensible default security headers (CSP, HSTS, frame options) for Express, Fastify or Hono.
Provides: middleware:security-headers
Requires: http
Dependencies
helmet@^8.1.0(whenhas('http/express'))@fastify/helmet@^13.0.2(whenhas('http/fastify'))
What it contributes to other files
| File | Slot | Line |
|---|---|---|
src/app.ts|js | imports | import helmet from 'helmet'; |
src/app.ts|js | middleware | app.use(helmet()); |
src/app.ts|js | imports | import fastifyHelmet from '@fastify/helmet'; |
src/app.ts|js | middleware | await app.register(fastifyHelmet); |
src/app.ts|js | imports | import { secureHeaders } from 'hono/secure-headers'; |
src/app.ts|js | middleware | app.use('*', secureHeaders()); |
Use it
atarashi new my-app --add mw/helmet
atarashi add mw/helmet
Version 1.0.0. Format reference: Authoring blueprints.
Part of the atarashi documentation, written and maintained by Gautam Suthar.