add anti spider config
Showing
3 changed files
with
8 additions
and
2 deletions
@@ -51,6 +51,11 @@ app.set('etag', false); | @@ -51,6 +51,11 @@ app.set('etag', false); | ||
51 | 51 | ||
52 | app.enable('trust proxy'); | 52 | app.enable('trust proxy'); |
53 | 53 | ||
54 | +// 请求限制中间件 | ||
55 | +if (!app.locals.devEnv) { | ||
56 | + app.use(require('./doraemon/middleware/limiter')); | ||
57 | +} | ||
58 | + | ||
54 | // 指定libray目录 | 59 | // 指定libray目录 |
55 | global.utils = path.resolve('./utils'); | 60 | global.utils = path.resolve('./utils'); |
56 | 61 |
@@ -107,7 +107,8 @@ module.exports = { | @@ -107,7 +107,8 @@ module.exports = { | ||
107 | key: '7e6f3307b64cc87c79c472814b88f7fb', | 107 | key: '7e6f3307b64cc87c79c472814b88f7fb', |
108 | appSecret: 'ce21ae4a3f93852279175a167e54509b', | 108 | appSecret: 'ce21ae4a3f93852279175a167e54509b', |
109 | notifyUrl: domains.service + 'payment/weixin_notify', | 109 | notifyUrl: domains.service + 'payment/weixin_notify', |
110 | - } | 110 | + }, |
111 | + maxQps: 1200 | ||
111 | }; | 112 | }; |
112 | 113 | ||
113 | if (isProduction) { | 114 | if (isProduction) { |
-
Please register or login to post a comment