how to only rate limit 1 endpoint in nest.js

Viewed 14

does including the module and useGuard this in one place allow me to ONLY rate limit this one service? if not what's the best way to rate limit a single endpoint?

ThrottlerModule.forRoot(),

@UseGuards(ThrottlerGuard)
@Throttle(10, 60)
@Query()
async myQuery() {
  return await this
}
1 Answers

What you have above is fine. That's how guards work, if you apply it to a single route, it'll only effect that route.

Related