INNER CODE UNIT · TypeScript

bootstrap

nartc/nest-mean · server/src/main.ts:6

async function bootstrap() {
    const app = await NestFactory.create(AppModule);
    const hostDomain = AppModule.isDev ? `${AppModule.host}:${AppModule.port}` : AppModule.host;

    const swaggerOptions = new DocumentBuilder()
        .setTitle('Nest MEAN')
        .setDescription('API Documentation')
        .setVersion('1.0.0')
        .setHost(hostDomain.split('//')[1])
        .setSchemes(AppModule.isDev ? 'http' : 'https')
        .setBasePath('/api')
        .addBearerAuth('Authorization', 'header')
        .build();

    const swaggerDoc = SwaggerModule.createDocument(app, swaggerOptions);

    SwaggerModule.setup('/api/docs', app, swaggerDoc, {
        swaggerUrl: `${hostDomain}/api/docs-json`,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…