Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const appModule = await import('@vendure/core/dist/app.module');
try {
DefaultLogger.hideNestBoostrapLogs();
const app = await NestFactory.create(appModule.AppModule, { cors: config.cors, logger: false });
let worker: INestMicroservice | undefined;
await app.listen(config.port);
if (config.workerOptions.runInMainProcess) {
const workerModule = await import('@vendure/core/dist/worker/worker.module');
worker = await NestFactory.createMicroservice(workerModule.WorkerModule, {
transport: config.workerOptions.transport,
logger: new Logger(),
options: config.workerOptions.options,
});
await worker.listenAsync();
}
DefaultLogger.restoreOriginalLogLevel();
return [app, worker];
} catch (e) {
console.log(e);
throw e;
}
}
}