How to use the @nestjs/core.NestFactory.createApplicationContext function in @nestjs/core

To help you get started, weโ€™ve selected a few @nestjs/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nestjs / nest / sample / 18-context / src / main.ts View on Github external
async function bootstrap() {
  const app = await NestFactory.createApplicationContext(AppModule);
  const appService = app.get(AppService);
  console.log(appService.getHello());
}
bootstrap();
github juicycleff / ultimate-backend / libs / nestjs-graphql-gateway / src / services / references-explorer.service.spec.ts View on Github external
beforeEach(async () => {
    app = await NestFactory.createApplicationContext(AppModule);
    referencesExplorer = app.get(ReferencesExplorerService);
  });
github lightness / github-repo-tools / src / app.ts View on Github external
async function bootstrap() {
  const app = await NestFactory.createApplicationContext(
    AppModule.forCli(), 
    { logger: new AppLogger() }
  );

  const appService = app.get(AppService);
  await appService.main();
}
github International-Slackline-Association / Rankings-Backend / src / image-resizer / index.ts View on Github external
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);
}
github Pop-Code / nestjs-console / src / bootstrap.ts View on Github external
static createAppContext(options: BootstrapConsoleOptions) {
        return NestFactory.createApplicationContext(
            options.module,
            options.contextOptions
        );
    }
}
github International-Slackline-Association / Rankings-Backend / src / cron-job / index.ts View on Github external
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,
        },
      }),
    );
}