File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ if (!process.env.ORG_ID) {
2222 exit ( 1 ) ;
2323}
2424
25- const limiter = rateLimit ( {
25+ const apiLimiter = rateLimit ( {
2626 windowMs : 10 * 60 * 1000 , // 10 minutes
27- limit : 300 , // limit each IP to 300 requests per windowMs
27+ limit : 400 , // limit each IP to 400 requests per windowMs
2828 keyGenerator : ( req ) => {
2929 const forwardFor = req . headers [ 'x-forwarded-for' ] ;
3030 if ( forwardFor && typeof forwardFor === 'string' ) {
@@ -54,7 +54,6 @@ await mongoose
5454debugDB ( "Connected to MongoDB Atlas." ) ;
5555
5656app . set ( "trust proxy" , 1 ) ; // Trust first proxy (i.e. ALB)
57- app . use ( limiter ) ;
5857app . use ( cookieParser ( ) ) ;
5958app . use ( helmet . hidePoweredBy ( ) ) ;
6059app . use (
@@ -105,7 +104,7 @@ app.use(
105104) ;
106105
107106// Serve API
108- app . use ( "/api/v1" , api ) ;
107+ app . use ( "/api/v1" , apiLimiter , api ) ;
109108app . use ( "/permalink" , permalinkRouter ) ;
110109
111110app . use ( "/health" , ( _req , res ) =>
You can’t perform that action at this time.
0 commit comments