Skip to content

Commit

Permalink
feat: gzip api responses AB#19925
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisvisser committed Jun 26, 2023
1 parent ef53651 commit a37af3e
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 20 deletions.
137 changes: 117 additions & 20 deletions services/API-service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions services/API-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@typescript-eslint/parser": "^2.34.0",
"class-transformer": "^0.3.1",
"class-validator": "^0.13.1",
"compression": "^1.7.4",
"crypto": "^1.0.1",
"crypto-js": "^4.0.0",
"cryptr": "^6.0.2",
Expand All @@ -60,6 +61,7 @@
},
"devDependencies": {
"@nestjs/cli": "^7.5.4",
"@types/compression": "^1.7.2",
"@types/express": "^4.17.14",
"@types/jest": "^26.0.20",
"@types/node": "^12.19.16",
Expand Down
2 changes: 2 additions & 0 deletions services/API-service/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@nestjs/swagger';
import { ValidationPipe } from '@nestjs/common';
import * as bodyParser from 'body-parser';
const compression = require('compression');

async function bootstrap(): Promise<void> {
const appOptions = { cors: true };
Expand Down Expand Up @@ -60,6 +61,7 @@ async function bootstrap(): Promise<void> {
extended: true,
}),
);
app.use(compression());
await app.listen(process.env.PORT || PORT);
}
bootstrap();

0 comments on commit a37af3e

Please sign in to comment.