This commit is contained in:
Christopher Cookman 2024-12-23 16:35:40 -07:00
parent fb88dc5137
commit d2f0d951c6
2 changed files with 19 additions and 0 deletions

17
fetchTest.js Normal file
View file

@ -0,0 +1,17 @@
const apiUrl = 'https://ubs.rtech.foundation/api/v1/info'; // Replace with your API URL
const interval = 1000; // 1 second
const callApi = async () => {
try {
const response = await fetch(apiUrl);
if (!response.ok) {
throw new Error('Network response was not ok');
}
const data = await response.json();
console.log('API Response:', data);
} catch (error) {
console.error('Error calling API:', error.message);
}
};
setInterval(callApi, interval);

View file

@ -4,6 +4,8 @@ if (!global.rateLimitList) {
global.rateLimitList = {};
}
console.log(process.env)
const middleware = (req, res, next) => {
// X requests per Y seconds per IP address
const maxRequests = process.env.RATE_LIMIT_MAX || 30;