git clone https://github.com/shhivam/ratelimiting4e.git
cd ratelimiting4e
make db-up
will run the redis in a docker containermake run
will run the Gin server on port 8080
This project has a GET /healthcheck
endpoint which is rate limited 10 requests per minute but you can easily change it in ratelimiter/healthcheck.go
file.
For the purpose of this exercise, I just hardcoded the rate limiting values.
The requests will return a 429 Status code if you send more than 10 requests in a minute to GET /healthcheck