minor fixes
This commit is contained in:
parent
d8e9106a40
commit
f435228f00
|
@ -85,7 +85,7 @@ app.use((req, res, next) => {
|
||||||
If you'd like to contribute or modify the package, you can clone the repository and run it locally:
|
If you'd like to contribute or modify the package, you can clone the repository and run it locally:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/yourusername/rate-limiter.git
|
git clone https://git.digimantra.com/abad_dml/rate-limiter
|
||||||
cd rate-limiter
|
cd rate-limiter
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
@ -111,7 +111,7 @@ If you encounter any problems or have any questions, feel free to open an issue
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
- **GitHub**: [https://github.com/yourusername/rate-limiter](https://github.com/yourusername/rate-limiter)
|
- **GitHub**: [https://git.digimantra.com/abad_dml/rate-limiter](https://git.digimantra.com/abad_dml/rate-limiter)
|
||||||
- **NPM**: [https://www.npmjs.com/package/rate-limiter](https://www.npmjs.com/package/rate-limiter)
|
- **NPM**: [https://www.npmjs.com/package/rate-limiter-digimantra](https://www.npmjs.com/package/rate-limiter-digimantra)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
1
index.js
1
index.js
|
@ -1,4 +1,3 @@
|
||||||
// index.js
|
|
||||||
const RateLimiter = require('./lib/rateLimiter');
|
const RateLimiter = require('./lib/rateLimiter');
|
||||||
|
|
||||||
// Middleware wrapper for Express.js or any other Node.js framework
|
// Middleware wrapper for Express.js or any other Node.js framework
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// lib/rateLimiter.js
|
|
||||||
|
|
||||||
class RateLimiter {
|
class RateLimiter {
|
||||||
constructor({ windowMs, maxRequests }) {
|
constructor({ windowMs, maxRequests }) {
|
||||||
// windowMs is the time window in milliseconds (e.g., 15 minutes = 15 * 60 * 1000)
|
// windowMs is the time window in milliseconds (e.g., 15 minutes = 15 * 60 * 1000)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "rate-limiter",
|
"name": "rate-limiter-digimantra",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"description": "Custom rate limiting middleware for Node.js",
|
"description": "Custom rate limiting middleware for Node.js",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
Loading…
Reference in a new issue