13 lines
436 B
TypeScript
13 lines
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);
|
||
|
}
|