🚀 Feature Proposal
It would be really helpful if one could add route based rate limiting without a handler function.
Motivation
I am using Fastify as a gateway in combination with fastify-gateway. With the gateway plugin (fastify-gateway) I can delegate handling to external services. By being able to add route based rate limiter without a handler parameter we can make the fastify-rate-limit plugin usable beyond typical route based rate limiting.
Example
Expected Behaviour:
fastify.register(fastifyRateLimit, { //just as an option
config: {
route: '/routeX',
rateLimit: {
max: 3,
timeWindow: '1 minute'
}
}
})
🚀 Feature Proposal
It would be really helpful if one could add route based rate limiting without a
handlerfunction.Motivation
I am using Fastify as a gateway in combination with fastify-gateway. With the gateway plugin (
fastify-gateway) I can delegate handling to external services. By being able to add route based rate limiter without a handler parameter we can make thefastify-rate-limitplugin usable beyond typical route based rate limiting.Example
Expected Behaviour: