mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-22 09:12:05 -07:00
fix(rate-limit.js): Refactored to use JS Class
This commit is contained in:
+4
-2
@@ -3,7 +3,9 @@
|
||||
const express = require("express")
|
||||
|
||||
// Middleware
|
||||
const { routeRateLimit } = require("./middleware/route-ratelimit")
|
||||
// const { routeRateLimit } = require("./middleware/route-ratelimit")
|
||||
const RateLimits = require("./middleware/route-ratelimit")
|
||||
const rateLimits = new RateLimits()
|
||||
|
||||
const path = require("path")
|
||||
const logger = require("morgan")
|
||||
@@ -84,7 +86,7 @@ app.use(`/${v3prefix}/`, auth.mw())
|
||||
|
||||
// Rate limit on all v3 routes
|
||||
// Establish and enforce rate limits.
|
||||
app.use(`/${v3prefix}/`, routeRateLimit)
|
||||
app.use(`/${v3prefix}/`, rateLimits.routeRateLimit)
|
||||
|
||||
app.use(`/${v3prefix}/` + `health-check`, healthCheckV3)
|
||||
app.use(`/${v3prefix}/` + `blockchain`, blockchainV3.router)
|
||||
|
||||
Reference in New Issue
Block a user