Skip to content

This Repo implements the Token bucket algorithm for request rate limit per user, using NestJs and Redis.

Notifications You must be signed in to change notification settings

minaroid/request-rate-limit-nestjs

Repository files navigation

Description

This Repo implements the Token bucket algorithm for request rate limit per user, using NestJs and Redis.

Installation

# Start a Redis via docker:
$ docker run -p 6379:6379 -it redis/redis-stack-server:latest
$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# Generate apiKey
$ localhost:3000/generate-api-key

# Test List movies using the generated key.
$ localhost:3000/movies?apiKey=KEY

About

This Repo implements the Token bucket algorithm for request rate limit per user, using NestJs and Redis.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published