Skip to content

Rate limiting without a handler #58

@ddsultan

Description

@ddsultan

🚀 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'
    }
  }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions