Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function bootstrap() {
const app = await NestFactory.createApplicationContext(AppModule);
const appService = app.get(AppService);
console.log(appService.getHello());
}
bootstrap();
beforeEach(async () => {
app = await NestFactory.createApplicationContext(AppModule);
referencesExplorer = app.get(ReferencesExplorerService);
});
async function bootstrap() {
const app = await NestFactory.createApplicationContext(
AppModule.forCli(),
{ logger: new AppLogger() }
);
const appService = app.get(AppService);
await appService.main();
}
async function bootstrap(records: S3EventRecord[]) {
const app = await NestFactory.createApplicationContext(S3EventsModule, {
logger: env_variables.isDev ? undefined : false,
});
const service = app.get(S3EventsService);
await service.processRecords(records);
}
static createAppContext(options: BootstrapConsoleOptions) {
return NestFactory.createApplicationContext(
options.module,
options.contextOptions
);
}
}
async function bootstrap() {
const app = await NestFactory.createApplicationContext(CronJobModule, {
logger: env_variables.isDev ? undefined : false,
});
const service = app.get(CronJobService);
return service
.runCronJobs()
.then(d => d)
.catch(err =>
logger.error('Cron Jobs Error', {
data: {
err: err.message,
},
}),
);
}