add compression middleware

This commit is contained in:
Jake Howard 2016-08-26 12:37:06 +01:00
parent 051b6fccd3
commit 9279aa0767
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 4 additions and 0 deletions

View file

@ -20,6 +20,7 @@
},
"homepage": "https://github.com/RealOrangeOne/host-container#readme",
"dependencies": {
"compression": "=1.6.2",
"connect-static-file": "=1.1.2",
"express": "=4.14.0"
},

View file

@ -1,5 +1,6 @@
const express = require('express');
const staticFile = require('connect-static-file');
const compression = require('compression');
const path = require('path');
const PORT = 5000;
@ -16,6 +17,8 @@ const expressConfig = {
const app = express();
app.use(compression({ level: 9 }));
app.use(function (request, response, next) {
if (directory.exec(request.url)) {