skip to Main Content

Javascript – How to reuse mutler settings to specify a different folder for a route

I initialize MutlerModule to app.module: MulterModule.registerAsync({ imports: [ ConfigModule ], inject: [ ConfigService ], async useFactory(configService: ConfigService) { const uploadFolder = configService.get<IConfig[ "uploadFolder" ]>("uploadFolder"); return { storage: diskStorage({ destination: uploadFolder, filename(req, file, cb) { const filename = `${ Date.now() }-${…

VIEW QUESTION

Why is CORS not working in NestJS APP + NGINX?

Why do I get cors error and invalid headers when requesting from frontend http://localhost:3000? async function bootstrap() { const app = await NestFactory.create(AppModule, { cors: true }); useContainer(app.select(AppModule), { fallbackOnErrors: true }); const configService = app.get(ConfigService<AllConfigType>); app.enableShutdownHooks(); app.setGlobalPrefix( configService.getOrThrow('app.apiPrefix', {…

VIEW QUESTION
Back To Top
Search