Skip to content

Commit

Permalink
Merge pull request #465 from alexlee-dev/compression
Browse files Browse the repository at this point in the history
✨ Optimize - Compression #450 - Add Compression
  • Loading branch information
Alex Lee committed Nov 10, 2020
2 parents 3b51ac5 + 249ba88 commit 0b93dd4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
17 changes: 11 additions & 6 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@tinymce/tinymce-react": "^3.8.1",
"bcryptjs": "^2.4.3",
"chalk": "^4.1.0",
"compression": "^1.7.4",
"cookie-parser": "^1.4.5",
"cors": "^2.8.5",
"express": "^4.17.1",
Expand All @@ -48,6 +49,7 @@
"devDependencies": {
"@types/bcryptjs": "^2.4.2",
"@types/chalk": "^2.2.0",
"@types/compression": "^1.7.0",
"@types/cookie-parser": "^1.4.2",
"@types/cors": "^2.8.8",
"@types/express": "^4.17.8",
Expand Down
2 changes: 2 additions & 0 deletions src/server/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import chalk from "chalk";
import cookieParser from "cookie-parser";
import compression from "compression";
import cors, { CorsOptions } from "cors";
import express, { Request, Response } from "express";
import mongoose from "mongoose";
Expand Down Expand Up @@ -35,6 +36,7 @@ class App {

this.app.use(cookieParser());
this.app.use(express.json());
this.app.use(compression());
if (process.env.NODE_ENV !== "development") {
this.app.use(rateLimiter);
}
Expand Down

0 comments on commit 0b93dd4

Please sign in to comment.