reset main for swagger
This commit is contained in:
parent
4cbb2ba64c
commit
65ae32dc87
16
src/main.ts
16
src/main.ts
@ -1,7 +1,8 @@
|
|||||||
import { NestFactory, Reflector } from '@nestjs/core';
|
import { NestFactory, Reflector } from '@nestjs/core';
|
||||||
import { AppModule } from './app.module';
|
import { AppModule } from './app.module';
|
||||||
import { ConfigService } from '@nestjs/config';
|
import { ConfigService } from '@nestjs/config';
|
||||||
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
|
import { SwaggerModule } from '@nestjs/swagger/dist/swagger-module';
|
||||||
|
import { DocumentBuilder } from '@nestjs/swagger';
|
||||||
import { AuthGuard } from './common/guards/auth.guard';
|
import { AuthGuard } from './common/guards/auth.guard';
|
||||||
import { JwtService } from '@nestjs/jwt';
|
import { JwtService } from '@nestjs/jwt';
|
||||||
import { RolesGuard } from './common/guards/roles.guard';
|
import { RolesGuard } from './common/guards/roles.guard';
|
||||||
@ -43,18 +44,7 @@ async function bootstrap() {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
const document = SwaggerModule.createDocument(app, config);
|
const document = SwaggerModule.createDocument(app, config);
|
||||||
SwaggerModule.setup('api-docs', app, document, {
|
SwaggerModule.setup('api-docs', app, document);
|
||||||
swaggerOptions: {
|
|
||||||
persistAuthorization: true,
|
|
||||||
},
|
|
||||||
customCssUrl: '/api-docs/swagger-ui.css',
|
|
||||||
customJs: [
|
|
||||||
'/api-docs/swagger-ui-bundle.js',
|
|
||||||
'/api-docs/swagger-ui-standalone-preset.js',
|
|
||||||
'/api-docs/swagger-ui-init.js',
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user