How to use the @nestjs/core.Reflector 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 mpcast / mpcast-server / packages / core / src / bootstrap.ts View on Github external
app = await NestFactory.create(appModule.AppModule, {
        cors: config.cors,
        logger: new Logger(),
    });
    app.setGlobalPrefix('api');
    // DefaultLogger.restoreOriginalLogLevel();
    // app.useLogger(new Logger());
    app.use(helmet());
    app.use(compression());
    app.use(bodyParser.json({ limit: '1mb' }));
    app.use(bodyParser.urlencoded({ extended: true }));
    // app.use(rateLimit({ max: 1000, windowMs: 15 * 60 * 1000 }));
    app.useGlobalFilters(new HttpExceptionFilter());
    app.useGlobalPipes(new ValidationPipe());
    app.useGlobalInterceptors(
        new TransformInterceptor(new Reflector()),
        new ErrorInterceptor(new Reflector()),
        new LoggingInterceptor(),
    );
    // const options = new DocumentBuilder()
    //   .setTitle('播客系统服务端 API')
    //   .setDescription('The Podcast API')
    //   .setVersion('2.0')
    //   .addTag('Podcast Server')
    //   .build();
    // const document = SwaggerModule.createDocument(app, options);
    // SwaggerModule.setup('apidoc', app, document);

    // return await app.listen(appConfig.APP.PORT);
    await app.listen(config.port, config.hostname);
    logWelcomeMessage(config);
    return app;
github mpcast / mpcast-server / src / main.ts View on Github external
async function bootstrap() {
  const app = await NestFactory.create(AppModule, isProdMode ? { logger: false } : null);
  // app.use()
  app.use(helmet());
  app.use(compression());
  app.use(bodyParser.json({ limit: '1mb' }));
  app.useGlobalFilters(new HttpExceptionFilter());
  app.useGlobalPipes(new ValidationPipe());
  app.useGlobalInterceptors(
    new TransformInterceptor(new Reflector()),
    new ErrorInterceptor(new Reflector()),
    new LoggingInterceptor(),
  );
  const options = new DocumentBuilder()
    .setTitle('播客系统服务端')
    .setDescription('The Podcast API')
    .setVersion('2.0')
    .addTag('Podcast Server')
    .build();
  const document = SwaggerModule.createDocument(app, options);
  SwaggerModule.setup('api', app, document);
  return await app.listen(appConfig.APP.PORT);
}
github mpcast / mpcast-server / src / main.ts View on Github external
async function bootstrap() {
  const app = await NestFactory.create(AppModule, isProdMode ? { logger: false } : null);
  // app.use()
  app.use(helmet());
  app.use(compression());
  app.use(bodyParser.json({ limit: '1mb' }));
  app.useGlobalFilters(new HttpExceptionFilter());
  app.useGlobalPipes(new ValidationPipe());
  app.useGlobalInterceptors(
    new TransformInterceptor(new Reflector()),
    new ErrorInterceptor(new Reflector()),
    new LoggingInterceptor(),
  );
  const options = new DocumentBuilder()
    .setTitle('播客系统服务端')
    .setDescription('The Podcast API')
    .setVersion('2.0')
    .addTag('Podcast Server')
    .build();
  const document = SwaggerModule.createDocument(app, options);
  SwaggerModule.setup('api', app, document);
  return await app.listen(appConfig.APP.PORT);
}
github surmon-china / nodepress / src / main.ts View on Github external
async function bootstrap() {
  const app = await NestFactory.create(
    AppModule,
    isProdMode ? { logger: false } : null,
  );
  app.use(helmet());
  app.use(compression());
  app.use(bodyParser.json({ limit: '1mb' }));
  app.use(bodyParser.urlencoded({ extended: true }));
  app.use(rateLimit({ max: 1000, windowMs: 15 * 60 * 1000 }));
  app.useGlobalFilters(new HttpExceptionFilter());
  app.useGlobalPipes(new ValidationPipe());
  app.useGlobalInterceptors(
    new TransformInterceptor(new Reflector()),
    new ErrorInterceptor(new Reflector()),
    new LoggingInterceptor(),
  );
  return await app.listen(APP_CONFIG.APP.PORT);
}
github surmon-china / nodepress / src / main.ts View on Github external
async function bootstrap() {
  const app = await NestFactory.create(
    AppModule,
    isProdMode ? { logger: false } : null,
  );
  app.use(helmet());
  app.use(compression());
  app.use(bodyParser.json({ limit: '1mb' }));
  app.use(bodyParser.urlencoded({ extended: true }));
  app.use(rateLimit({ max: 1000, windowMs: 15 * 60 * 1000 }));
  app.useGlobalFilters(new HttpExceptionFilter());
  app.useGlobalPipes(new ValidationPipe());
  app.useGlobalInterceptors(
    new TransformInterceptor(new Reflector()),
    new ErrorInterceptor(new Reflector()),
    new LoggingInterceptor(),
  );
  return await app.listen(APP_CONFIG.APP.PORT);
}