Update server.js
Browse files
server.js
CHANGED
@@ -14,9 +14,9 @@ app.use('/api', (req, res, next) => {
|
|
14 |
const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
15 |
const currentCount = ipRequestCounts[ip] || 0;
|
16 |
|
17 |
-
if (currentCount >=
|
18 |
// Send a more generic message without mentioning IP-based limitation
|
19 |
-
return res.status(429).send('
|
20 |
}
|
21 |
|
22 |
// Increment request counter for the IP
|
|
|
14 |
const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
15 |
const currentCount = ipRequestCounts[ip] || 0;
|
16 |
|
17 |
+
if (currentCount >= 10) {
|
18 |
// Send a more generic message without mentioning IP-based limitation
|
19 |
+
return res.status(429).send('You reached 10 message limit. Contact me on reddit for more.');
|
20 |
}
|
21 |
|
22 |
// Increment request counter for the IP
|