tiny-url-nestjs-microservice/swagger.ts
2024-01-22 15:30:01 +02:00

13 lines
No EOL
436 B
TypeScript

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);
}