INNER CODE UNIT · TypeScript

bootstrap

tkssharma/nestjs-microservices · apps/nestjs-http-gateway/src/main.ts:8

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  const options = new DocumentBuilder()
    .setTitle('API docs')
    .addBearerAuth(
      { type: 'http', scheme: 'bearer', bearerFormat: 'JWT' },
      'authorization',
    )
    .addTag('users')
    .addTag('tasks')
    .setVersion('1.0')
    .build();
  const document = SwaggerModule.createDocument(app, options);
  SwaggerModule.setup('docs', app, document);
  await app.listen(Number(new ConfigService().get().port));
}
bootstrap();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…