mirror of
https://github.com/darkwire/darkwire.io.git
synced 2025-07-18 10:49:02 +00:00
Use gzip compression
This commit is contained in:
parent
199a459010
commit
68a56cc854
@ -5,6 +5,7 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babel": "^5.8.23",
|
"babel": "^5.8.23",
|
||||||
|
"compression": "^1.6.0",
|
||||||
"connect-redis": "^3.0.1",
|
"connect-redis": "^3.0.1",
|
||||||
"express": "^4.13.3",
|
"express": "^4.13.3",
|
||||||
"express-session": "^1.12.1",
|
"express-session": "^1.12.1",
|
||||||
|
@ -9,6 +9,7 @@ import shortid from 'shortid';
|
|||||||
import _ from 'underscore';
|
import _ from 'underscore';
|
||||||
import Room from './room';
|
import Room from './room';
|
||||||
import favicon from 'serve-favicon';
|
import favicon from 'serve-favicon';
|
||||||
|
import compression from 'compression';
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const server = http.createServer(app);
|
const server = http.createServer(app);
|
||||||
@ -31,6 +32,7 @@ io.use(function(socket, next) {
|
|||||||
sessionMiddleware(socket.request, socket.request.res, next);
|
sessionMiddleware(socket.request, socket.request.res, next);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.use(compression());
|
||||||
app.use(favicon(__dirname + '/public/favicon.ico'));
|
app.use(favicon(__dirname + '/public/favicon.ico'));
|
||||||
app.engine('mustache', mustacheExpress());
|
app.engine('mustache', mustacheExpress());
|
||||||
app.set('view engine', 'mustache');
|
app.set('view engine', 'mustache');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user