Not able to Implement Rate Limit
See original GitHub issueI am trying to implement rate limiting in fast-gateway but I am not able to use it since it expects the req.ip object which I believe is not available with fast-gateway. Does that mean I need to import express and create app just to do rate-limiting?
It’d be great if someone pointed out some examples to get me started.
Just used the sample code to get started:
require('dotenv').config();
const gateway = require('fast-gateway')
const PORT = process.env.PORT || 9090
const service = gateway({
middlewares: [
require('cors')(),
require('helmet')(),
],
// Can add routes here!
routes: [{
prefix: '/verify',
target: process.env.VERIFICATION_API
}]
});
service.start(PORT).then(server => {
console.log(`API Gateway listening on ${PORT} port!`)
})
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
Application unable to work due to rate limiter - Stack Overflow
I have tried to implement rate limiter on server.js but it gives this error below making the website crash. Did I implement the...
Read more >Understanding and implementing rate limiting in Node.js
Explore the concept of rate limiting in Node.js — what it is, how it works, various ways to implement it, and some practical...
Read more >Rate-limiting strategies and techniques - Google Cloud
When the capacity of a service is shared among many users or consumers, it can apply rate limiting per user to provide fair...
Read more >How to avoid hitting rate limits in API integration - Elastic.io
We'll go through different API rate limiting techniques as well as strategies and workarounds to recover from them or generally avoid them.
Read more >Implement API rate limiting to reduce attack surfaces
Rate limiting can help developers prevent APIs from being overwhelmed with requests, thus preventing denial-of-service attacks. Learn how to implement rate ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @rajkumarpb, next I describe a full example:
Gateway:
Remote Service:
Please let me know if it works for you now?
Regards
I will provide you more feedback here ASAP