I created .env
APP_PORT=3001
DEST=C:\data\formations
I have configService:ConfigService in the controller contractor. I want to get DEST for destination from .env in this code.
@UseInterceptors(FileInterceptor('file', {
storage: diskStorage({
destination: /*here*/ ,
filename: (req, file, cb) => {
const filename: string = path.parse(file.originalname).name.replace(/\s/g, '')
const extension: string = path.parse(file.originalname).ext
cb(null, `${filename}${extension}`)
}
})
}))
When I use this inside this other object I get an error.