Skip to content

Commit

Permalink
add server compression
Browse files Browse the repository at this point in the history
  • Loading branch information
flyfishzy committed Jan 27, 2024
1 parent dd13f43 commit 95a327b
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 40 deletions.
1 change: 1 addition & 0 deletions server/realword-express-sequelize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dependencies": {
"bcryptjs": "^2.4.3",
"colors": "^1.4.0",
"compression": "^1.7.4",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"jsonwebtoken": "^8.5.1",
Expand Down
94 changes: 54 additions & 40 deletions server/realword-express-sequelize/pnpm-lock.yaml

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

2 changes: 2 additions & 0 deletions server/realword-express-sequelize/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { errorHandler } = require("./middlewares/errorHandler");
const http = require("http");
const https = require("https");
const fs = require("fs");
const compression = require('compression');

// Import Models
const User = require("./models/User");
Expand All @@ -18,6 +19,7 @@ dotenv.config({ path: "config.env" });

const app = express();

app.use(compression());
// Body parser
app.use(express.json());

Expand Down

0 comments on commit 95a327b

Please sign in to comment.