mirror of https://github.com/fantasticit/think.git
server: add compression
This commit is contained in:
parent
88c2769fa6
commit
f6c5e72126
|
@ -35,6 +35,7 @@
|
|||
"bcryptjs": "^2.4.3",
|
||||
"class-transformer": "^0.5.1",
|
||||
"class-validator": "^0.13.2",
|
||||
"compression": "^1.7.4",
|
||||
"date-fns": "^2.28.0",
|
||||
"express": "^4.17.2",
|
||||
"express-rate-limit": "^6.2.0",
|
||||
|
|
|
@ -3,6 +3,7 @@ import { ConfigService } from '@nestjs/config';
|
|||
import { NestFactory } from '@nestjs/core';
|
||||
import { ValidationPipe } from '@pipes/validation.pipe';
|
||||
import { HttpResponseTransformInterceptor } from '@transforms/http-response.transform';
|
||||
import * as compression from 'compression';
|
||||
import * as express from 'express';
|
||||
import helmet from 'helmet';
|
||||
|
||||
|
@ -16,6 +17,7 @@ async function bootstrap() {
|
|||
const port = config.get('server.port') || 5002;
|
||||
|
||||
app.enableCors();
|
||||
app.use(compression());
|
||||
app.use(helmet());
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
|
|
Loading…
Reference in New Issue