23 lines
665 B
TypeScript
23 lines
665 B
TypeScript
import type { INestApplication } from '@nestjs/common';
|
|
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
|
|
|
export function getSwaggerConfig(app: INestApplication) {
|
|
const config = new DocumentBuilder()
|
|
.setTitle('Tahavol API')
|
|
.setDescription('API documentation for Tahavol backend')
|
|
.setVersion('1.0')
|
|
.addBearerAuth() // optional: for JWT endpoints
|
|
.build();
|
|
|
|
const document = SwaggerModule.createDocument(app, config);
|
|
|
|
SwaggerModule.setup('docs', app, document, {
|
|
swaggerOptions: {
|
|
persistAuthorization: true,
|
|
displayRequestDuration: true,
|
|
filter: true,
|
|
showExtensions: true,
|
|
},
|
|
});
|
|
}
|