Spaces:
Running
Running
Update app.js
Browse files
app.js
CHANGED
|
@@ -34,7 +34,7 @@ app.use(express.json({ limit: '50mb' }));
|
|
| 34 |
// 1. Burst Limiter (Per Minute): Stops rapid-fire spam / button mashing
|
| 35 |
const burstLimiter = rateLimit({
|
| 36 |
windowMs: 60 * 1000, // 1 minute window
|
| 37 |
-
max:
|
| 38 |
message: {
|
| 39 |
success: false,
|
| 40 |
error: "Whoa there, speedy! 🙀 Please wait a minute before scanning again."
|
|
@@ -46,7 +46,7 @@ const burstLimiter = rateLimit({
|
|
| 46 |
// 2. Daily Limiter (Cost Control): Stops API bankruptcy
|
| 47 |
const dailyLimiter = rateLimit({
|
| 48 |
windowMs: 24 * 60 * 60 * 1000, // 24 hours
|
| 49 |
-
max:
|
| 50 |
message: {
|
| 51 |
success: false,
|
| 52 |
error: "Daily scan limit reached! 🛑 Check back tomorrow or follow us on socials for updates."
|
|
|
|
| 34 |
// 1. Burst Limiter (Per Minute): Stops rapid-fire spam / button mashing
|
| 35 |
const burstLimiter = rateLimit({
|
| 36 |
windowMs: 60 * 1000, // 1 minute window
|
| 37 |
+
max: 60, // Max 60 requests per minute per IP
|
| 38 |
message: {
|
| 39 |
success: false,
|
| 40 |
error: "Whoa there, speedy! 🙀 Please wait a minute before scanning again."
|
|
|
|
| 46 |
// 2. Daily Limiter (Cost Control): Stops API bankruptcy
|
| 47 |
const dailyLimiter = rateLimit({
|
| 48 |
windowMs: 24 * 60 * 60 * 1000, // 24 hours
|
| 49 |
+
max: 5000, // 400, // Max 30 requests per DAY per IP (Adjust this number based on your budget)
|
| 50 |
message: {
|
| 51 |
success: false,
|
| 52 |
error: "Daily scan limit reached! 🛑 Check back tomorrow or follow us on socials for updates."
|