This is how I’m trying to add helmet
to my nestJS application. Additionally I need to add graphqlUploadExpress
How do I correctly use the usesUpload
condition to use helm
or helm + upload
?
import { NestFactory } from '@nestjs/core'
import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.js'
import helmet from 'helmet'
const upload = graphqlUploadExpress()
export const main = async (
AppModule: unknown,
usesUpload = false
) => {
const app = await NestFactory.create(AppModule, options)
app.use(usesUpload ? helm : helm, upload) // <-- I think, this is not correct
await app.listen(3000)
}