How can I disable auto-generated Etags in Nestjs? It's based on Express, so there something like
expressApp.set('etag', false);
should do the trick.
How can I access express app from NestJs main?
You can drop down to the express adapter using getHttpAdapter(), so you can do something like
const bootstrap = async () => {
const app = await NestFactory.create<NestExpressApplication>(AppModule);
app.getHttpAdapter().getInstance().set('etag', false);
await app.listen(3000);
}
Docs on HttpAdapter here
Thanks rodorgas for the .getInstance() addition
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With