Skip to content

Commit

Permalink
Remove rate limits on health route
Browse files Browse the repository at this point in the history
  • Loading branch information
uditdc committed Oct 21, 2024
1 parent 864ac7c commit 2d0bf36
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
3 changes: 1 addition & 2 deletions packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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))

Expand Down
19 changes: 10 additions & 9 deletions packages/api/src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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

0 comments on commit 2d0bf36

Please sign in to comment.