test push
This commit is contained in:
12
src/main.ts
12
src/main.ts
@@ -1,6 +1,7 @@
|
|||||||
import { ValidationPipe } from '@nestjs/common';
|
import { ValidationPipe } from '@nestjs/common';
|
||||||
import { ConfigService } from '@nestjs/config';
|
import { ConfigService } from '@nestjs/config';
|
||||||
import { NestFactory, Reflector } from '@nestjs/core';
|
import { NestFactory, Reflector } from '@nestjs/core';
|
||||||
|
import { Request, Response } from 'express';
|
||||||
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
||||||
import { AppModule } from './app.module';
|
import { AppModule } from './app.module';
|
||||||
import { ResponseInterceptor } from './common/interceptors/response.interceptor';
|
import { ResponseInterceptor } from './common/interceptors/response.interceptor';
|
||||||
@@ -30,6 +31,17 @@ async function bootstrap() {
|
|||||||
);
|
);
|
||||||
app.useGlobalInterceptors(new ResponseInterceptor(reflector));
|
app.useGlobalInterceptors(new ResponseInterceptor(reflector));
|
||||||
|
|
||||||
|
app.use(['/docs', '/docs-json'], (_request: Request, response: Response, next) => {
|
||||||
|
response.setHeader(
|
||||||
|
'Cache-Control',
|
||||||
|
'no-store, no-cache, must-revalidate, proxy-revalidate',
|
||||||
|
);
|
||||||
|
response.setHeader('Pragma', 'no-cache');
|
||||||
|
response.setHeader('Expires', '0');
|
||||||
|
response.setHeader('Surrogate-Control', 'no-store');
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
|
||||||
const swaggerConfig = new DocumentBuilder()
|
const swaggerConfig = new DocumentBuilder()
|
||||||
.setTitle('ParsShop API')
|
.setTitle('ParsShop API')
|
||||||
.setDescription('Phase 1 API documentation for ParsShop')
|
.setDescription('Phase 1 API documentation for ParsShop')
|
||||||
|
|||||||
Reference in New Issue
Block a user