Setup
npm i @nestjs/swagger
npm i swagger-ui-expressconst appName = process.env.APP_NAME || 'Backend API';
const options = new DocumentBuilder()
.setTitle(appName)
.setVersion('1.0')
.addBearerAuth({ in: 'header', type: 'http' })
.build();
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup('/', app, document, { customSiteTitle: appName });Last updated