edit for swagger
This commit is contained in:
parent
670a8c5b46
commit
24c508187b
14
src/main.ts
14
src/main.ts
@ -23,9 +23,7 @@ async function bootstrap() {
|
|||||||
const configService = app.get(ConfigService);
|
const configService = app.get(ConfigService);
|
||||||
|
|
||||||
const port = configService.get<number>('app.port', 3000);
|
const port = configService.get<number>('app.port', 3000);
|
||||||
app.setGlobalPrefix('api/v1', {
|
app.setGlobalPrefix('api/v1');
|
||||||
exclude: ['/api-docs'],
|
|
||||||
});
|
|
||||||
|
|
||||||
const config = new DocumentBuilder()
|
const config = new DocumentBuilder()
|
||||||
.setTitle("P'titsPas API")
|
.setTitle("P'titsPas API")
|
||||||
@ -45,15 +43,15 @@ 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/v1/api-docs', app, document, {
|
||||||
swaggerOptions: {
|
swaggerOptions: {
|
||||||
persistAuthorization: true,
|
persistAuthorization: true,
|
||||||
},
|
},
|
||||||
customCssUrl: '/api-docs/swagger-ui.css',
|
customCssUrl: '/api/v1/api-docs/swagger-ui.css',
|
||||||
customJs: [
|
customJs: [
|
||||||
'/api-docs/swagger-ui-bundle.js',
|
'/api/v1/api-docs/swagger-ui-bundle.js',
|
||||||
'/api-docs/swagger-ui-standalone-preset.js',
|
'/api/v1/api-docs/swagger-ui-standalone-preset.js',
|
||||||
'/api-docs/swagger-ui-init.js',
|
'/api/v1/api-docs/swagger-ui-init.js',
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user