Newer
Older
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { ValidationPipe } from '@nestjs/common';
import * as fs from 'fs';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors({ credentials: true, origin: true});
const options = new DocumentBuilder()
.setBasePath('')
.setTitle('Email service API')
.setDescription('Service providing the method to send emails.')
FORESTIER Fabien
committed
.addTag('email')
.build();
const document = SwaggerModule.createDocument(app, options);
fs.writeFileSync('./swagger-spec.json', JSON.stringify(document));
SwaggerModule.setup('api-doc', app, document);