diff --git a/fetchTest.js b/fetchTest.js new file mode 100644 index 0000000..2b83caf --- /dev/null +++ b/fetchTest.js @@ -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); \ No newline at end of file diff --git a/rateLimit.js b/rateLimit.js index 6503a6f..860a8f0 100644 --- a/rateLimit.js +++ b/rateLimit.js @@ -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;