Skip to content

Commit 5fb1217

Browse files
committed
Compress responses
1 parent 83213cd commit 5fb1217

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

app/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const path = require('path');
22
const express = require('express');
3+
const compression = require('compression');
34
const app = express();
45

56
const frontend = require('./frontend');
@@ -10,6 +11,7 @@ const {
1011
credentials,
1112
} = require('../environment');
1213

14+
app.use(compression());
1315
app.use((req, res, next) => {
1416
if (req.hostname === 'algo-visualizer.jasonpark.me') {
1517
res.redirect(301, 'https://algorithm-visualizer.org/');

package-lock.json

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"axios": "latest",
3232
"bluebird": "latest",
3333
"body-parser": "^1.18.2",
34+
"compression": "^1.7.3",
3435
"cookie-parser": "^1.4.3",
3536
"express": "^4.15.4",
3637
"express-github-webhook": "^1.0.6",

0 commit comments

Comments
 (0)