@@ -17,6 +17,9 @@ import {
17
17
addContextMiddleware ,
18
18
blockBotByUserAgentMiddleware ,
19
19
notFoundMiddleware ,
20
+ rateLimitMediumMiddleware ,
21
+ rateLimitStandardMiddleware ,
22
+ rateLimitStrictMiddleware ,
20
23
setApplicationCookieMiddleware ,
21
24
} from './app/routes/route.middleware' ;
22
25
import { blockBotHandler , healthCheck , uncaughtErrorHandler } from './app/utils/response.handlers' ;
@@ -235,11 +238,11 @@ if (ENV.NODE_ENV === 'production' && cluster.isPrimary) {
235
238
app . use ( json ( { limit : '20mb' , verify : rawBodySaver , type : [ 'json' , 'application/csp-report' ] } ) ) ;
236
239
app . use ( urlencoded ( { extended : true } ) ) ;
237
240
238
- app . use ( '/healthz' , healthCheck ) ;
239
- app . use ( '/api' , apiRoutes ) ;
240
- app . use ( '/static' , staticAuthenticatedRoutes ) ; // these are routes that return files or redirect (e.x. NOT JSON)
241
- app . use ( '/oauth' , oauthRoutes ) ; // NOTE: there are also static files with same path
242
- app . use ( '/webhook' , webhookRoutes ) ;
241
+ app . use ( '/healthz' , rateLimitStandardMiddleware , healthCheck ) ;
242
+ app . use ( '/api' , rateLimitStandardMiddleware , apiRoutes ) ;
243
+ app . use ( '/static' , rateLimitMediumMiddleware , staticAuthenticatedRoutes ) ; // these are routes that return files or redirect (e.x. NOT JSON)
244
+ app . use ( '/oauth' , rateLimitStrictMiddleware , oauthRoutes ) ; // NOTE: there are also static files with same path
245
+ app . use ( '/webhook' , rateLimitMediumMiddleware , webhookRoutes ) ;
243
246
244
247
if ( ENV . ENVIRONMENT !== 'production' || ENV . IS_CI ) {
245
248
app . use ( '/test' , testRoutes ) ;
0 commit comments