Closed Dmitriyx closed 1 year ago
Your code on the left is not the same as the doc code on the right.
A necessary await
is missing in front of fastify.register(plugin)
thanks for the quick response. I thought perhaps it would still work since the routes registered correctly ( in my other project ). I will test with top level await and have an update here.
works! thanks for the help
Prerequisites
Fastify version
4.15
Plugin version
8.0
Node.js version
18
Operating system
MacOS
Operating system version (i.e. 20.04, 11.3, 10)
Macbook Pro M2 Chip Ventura 13.0
Description
Start the server and try to hit the rate limit. Seems like it is not working. I followed the documentation and even made a separate project to test this.
Steps to Reproduce
Package JSON:
server.js
Expected Behavior
exptected to hit rate limit after starting server and spamming GET expoint, but what happens is that I get status code 200.
I tried to tinker with this many times and I do not have any success.
Source: https://github.com/fastify/fastify-rate-limit