diff --git a/backend/server.ts b/backend/server.ts index b2a7c423..266581ce 100644 --- a/backend/server.ts +++ b/backend/server.ts @@ -3,6 +3,7 @@ import * as _express from "express"; import * as _session from "express-session"; import * as _bodyParser from "body-parser"; +import * as _compress from "compression"; import * as _debug from "debug"; import * as _http from "http"; import {PublicRouter} from "./routes/PublicRouter"; @@ -35,6 +36,9 @@ export class Server { this.app.use(_morgan('dev')); } + //enable gzip + this.app.use(_compress()); + /** * Session above all */ diff --git a/package.json b/package.json index 24cb1e6f..af51407f 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "@angular/router": "2.0.0-rc.1", "@angular/router-deprecated": "2.0.0-rc.1", "body-parser": "^1.15.0", + "compression": "^1.6.1", "core-js": "^2.3.0", "debug": "^2.2.0", "ejs": "^2.4.1", diff --git a/typings.json b/typings.json index 691ccd54..94f4cd66 100644 --- a/typings.json +++ b/typings.json @@ -3,6 +3,7 @@ "version": false, "ambientDependencies": { "body-parser": "registry:dt/body-parser#0.0.0+20160317120654", + "compression": "registry:dt/compression#0.0.0+20160501162003", "core-js": "registry:dt/core-js#0.0.0+20160317120654", "debug": "github:DefinitelyTyped/DefinitelyTyped/debug/debug.d.ts#0d622d857f97d44ea7dcad2b3edec1f23c48fe9e", "express": "github:DefinitelyTyped/DefinitelyTyped/express/express.d.ts#0d622d857f97d44ea7dcad2b3edec1f23c48fe9e",