tiny-url-nestjs-microservice/swagger.ts

13 lines
436 B
TypeScript
Raw Normal View History

2024-01-22 13:30:01 +00:00
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { INestApplication } from '@nestjs/common';
export function setupSwagger(app: INestApplication): void {
const options = new DocumentBuilder()
.setTitle('Your API Title')
.setDescription('API description')
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup('api', app, document);
}