Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
姜枫
2017-03-06 11:48:46 +0800
Commit
7190f3cd886c366d7dc34ba32f24b72741874e4a
1 parent
e64897ed
add anti spider config
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
app.js
config/common.js
doraemon/middleware/limiter/rules/qps-limit.js
app.js
View file @
7190f3c
...
...
@@ -51,6 +51,11 @@ app.set('etag', false);
app
.
enable
(
'trust proxy'
);
// 请求限制中间件
if
(
!
app
.
locals
.
devEnv
)
{
app
.
use
(
require
(
'./doraemon/middleware/limiter'
));
}
// 指定libray目录
global
.
utils
=
path
.
resolve
(
'./utils'
);
...
...
config/common.js
View file @
7190f3c
...
...
@@ -107,7 +107,8 @@ module.exports = {
key
:
'7e6f3307b64cc87c79c472814b88f7fb'
,
appSecret
:
'ce21ae4a3f93852279175a167e54509b'
,
notifyUrl
:
domains
.
service
+
'payment/weixin_notify'
,
}
},
maxQps
:
1200
};
if
(
isProduction
)
{
...
...
doraemon/middleware/limiter/rules/qps-limit.js
View file @
7190f3c
...
...
@@ -45,7 +45,7 @@ module.exports = (limiter, policy) => {
}
if
(
pageIncr
>
0
)
{
cache
.
incrAsync
(
key
,
pageIncr
);
cache
.
incrAsync
(
key
,
pageIncr
,
(
err
)
=>
{}
);
}
});
...
...
Please
register
or
login
to post a comment