@nestjs/swagger
swagger-ui-express
Import the following:
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
Add the following to the bootstrap function in main.ts
:
const options = new DocumentBuilder()
.setTitle('My API')
.setDescription('The My API description')
.setVersion('1.0')
.addTag('myApi')
.build();
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup(`api`, app, document);