Authored by 姜枫

add express gzip

@@ -13,6 +13,7 @@ const yohoLib = require('yoho-node-lib'); @@ -13,6 +13,7 @@ const yohoLib = require('yoho-node-lib');
13 13
14 const express = require('express'); 14 const express = require('express');
15 const path = require('path'); 15 const path = require('path');
  16 +const compression = require('compression');
16 const bodyParser = require('body-parser'); 17 const bodyParser = require('body-parser');
17 const cookieParser = require('cookie-parser'); 18 const cookieParser = require('cookie-parser');
18 const favicon = require('serve-favicon'); 19 const favicon = require('serve-favicon');
@@ -63,6 +64,7 @@ app.use(bodyParser.urlencoded({ @@ -63,6 +64,7 @@ app.use(bodyParser.urlencoded({
63 extended: false 64 extended: false
64 })); 65 }));
65 app.use(cookieParser()); 66 app.use(cookieParser());
  67 +app.use(compression());
66 68
67 app.use(session({ 69 app.use(session({
68 name: 'yohobuy_session_cookie', 70 name: 'yohobuy_session_cookie',
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
21 "bluebird": "^3.4.6", 21 "bluebird": "^3.4.6",
22 "body-parser": "^1.15.2", 22 "body-parser": "^1.15.2",
23 "cheerio": "^0.22.0", 23 "cheerio": "^0.22.0",
  24 + "compression": "^1.6.2",
24 "connect-multiparty": "^2.0.0", 25 "connect-multiparty": "^2.0.0",
25 "cookie-parser": "^1.4.3", 26 "cookie-parser": "^1.4.3",
26 "cookie-session": "^1.2.0", 27 "cookie-session": "^1.2.0",