I'm using Nestjs (7.x) and Fastify (with @nestjs/platform-fastify
).
I'm trying to install Helmet in my project (fastify-helmet
), but I'm not able to figure how to integrate/configure it with Nestjs. What's the proper way to have it onboard?
Here is my Nestjs bootstrap:
import { NestFactory } from '@nestjs/core';
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
import { MainModule } from './main.module';
import * as helmet from 'fastify-helmet';
async function bootstrap() {
const app = await NestFactory.create<NestFastifyApplication>(MainModule);
await app.listen(3000, 0.0.0.0);
}
bootstrap();
try this instead. import fastifyHelmet from the package, use that to register.