Skip to content

Commit

Permalink
Merge pull request #268 from EigenExplorer/hotfix/remove-rate-limits-…
Browse files Browse the repository at this point in the history
…health-route

Remove rate limits on health route
  • Loading branch information
uditdc authored Oct 21, 2024
2 parents 8cf3e68 + 2d0bf36 commit 3c81974
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 3c81974

Please sign in to comment.