Ayeantics commited on
Commit
a627ace
·
verified ·
1 Parent(s): cb34952

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +2 -2
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 >= 20) {
18
  // Send a more generic message without mentioning IP-based limitation
19
- return res.status(429).send('Too many requests. Please try again later.');
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