UNPKG
fjh
Version:
latest (2.0.2)
2.0.2
2.0.1
2.0.0
1.1.2
1.1.1
1.1.0
1.0.0
博客api
fjh
/
public
/
limit.js
11 lines
(9 loc)
•
217 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
const
rateLimit =
require
(
'express-rate-limit'
);
const
limiter1 =
rateLimit
({
windowMs
:
60
*
1000
,
max
:
10
,
keyGenerator
:
function
(
req
) {
return
req.
ip
; } });
module
.
exports
= { limiter1 }