diff --git a/package.json b/package.json index e565841..001866a 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/server.js b/server.js index 5ff85ae..0edfe8f 100644 --- a/server.js +++ b/server.js @@ -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)) {