From 2d0bf36ca44c9689f6875f2482b127c3eec3b774 Mon Sep 17 00:00:00 2001 From: Udit <25996904+uditdc@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:04:26 +0530 Subject: [PATCH] Remove rate limits on health route --- packages/api/src/index.ts | 3 +-- packages/api/src/routes/index.ts | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/api/src/index.ts b/packages/api/src/index.ts index b1881637..547fb009 100644 --- a/packages/api/src/index.ts +++ b/packages/api/src/index.ts @@ -8,7 +8,6 @@ import helmet from 'helmet' import cors from 'cors' import apiRouter from './routes' import { EigenExplorerApiError, handleAndReturnErrorResponse } from './schema/errors' -import { rateLimiter } from './utils/auth' const PORT = process.env.PORT ? Number.parseInt(process.env.PORT) : 3002 @@ -24,7 +23,7 @@ app.use(express.urlencoded({ extended: false })) app.use(cookieParser()) // Routes -app.use('/', rateLimiter, apiRouter) +app.use('/', apiRouter) app.get('/favicon.ico', (req, res) => res.sendStatus(204)) diff --git a/packages/api/src/routes/index.ts b/packages/api/src/routes/index.ts index a964e8a6..a900ffb1 100644 --- a/packages/api/src/routes/index.ts +++ b/packages/api/src/routes/index.ts @@ -8,6 +8,7 @@ import withdrawalRoutes from './withdrawals/withdrawalRoutes' import depositRoutes from './deposits/depositRoutes' import auxiliaryRoutes from './auxiliary/auxiliaryRoutes' import rewardRoutes from './rewards/rewardRoutes' +import { rateLimiter } from '../utils/auth' const apiRouter = express.Router() @@ -20,14 +21,14 @@ apiRouter.get('/version', (_, res) => ) // Remaining routes -apiRouter.use('/avs', avsRoutes) -apiRouter.use('/strategies', strategiesRoutes) -apiRouter.use('/operators', operatorRoutes) -apiRouter.use('/stakers', stakerRoutes) -apiRouter.use('/metrics', metricRoutes) -apiRouter.use('/withdrawals', withdrawalRoutes) -apiRouter.use('/deposits', depositRoutes) -apiRouter.use('/aux', auxiliaryRoutes) -apiRouter.use('/rewards', rewardRoutes) +apiRouter.use('/avs', rateLimiter, avsRoutes) +apiRouter.use('/strategies', rateLimiter, strategiesRoutes) +apiRouter.use('/operators', rateLimiter, operatorRoutes) +apiRouter.use('/stakers', rateLimiter, stakerRoutes) +apiRouter.use('/metrics', rateLimiter, metricRoutes) +apiRouter.use('/withdrawals', rateLimiter, withdrawalRoutes) +apiRouter.use('/deposits', rateLimiter, depositRoutes) +apiRouter.use('/aux', rateLimiter, auxiliaryRoutes) +apiRouter.use('/rewards', rateLimiter, rewardRoutes) export default apiRouter