Trying to incorporate helmet
into my nestJS application. I also require the inclusion of graphqlUploadExpress
. How can I properly utilize the usesUpload
condition to implement either helmet
alone or along with 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) // <-- Appears incorrectly formatted.
await app.listen(3000)
}