@canmertinyo/rate-limit-express 1.3.6 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Express Rate Limiter
2
2
 
3
- ### A simple in-memory rate-limiting middleware for Express.js to restrict the number of requests a client can make within a given time. Ideal for lightweight use cases
3
+ ### This middleware helps to restrict the number of requests a client can make within a given time period. It's ideal for lightweight use cases and can be easily extended with in-memory, Redis, or MongoDB as storage options.
4
4
 
5
5
  To install :
6
6
 
@@ -13,8 +13,6 @@ exports.MongoStorage = void 0;
13
13
  const mongoose_1 = require("mongoose");
14
14
  const rate_limit_schema_1 = require("./schemas/rate-limit.schema");
15
15
  class MongoStorage {
16
- //DEFAULT DB URI VERRIRSEK PATLICAZ GİBİ AMA BAKARIZ, AZ KÖTÜ🤨
17
- //connect-mongo kütüphanesini kullanarak yapsak?
18
16
  constructor(mongoDbUrl = "mongodb://127.0.0.1:27017") {
19
17
  this.mongoDbUrl = mongoDbUrl;
20
18
  mongoose_1.default
@@ -31,6 +31,7 @@ class RedisStorage {
31
31
  }
32
32
  createRateLimitRecord(record) {
33
33
  return __awaiter(this, void 0, void 0, function* () {
34
+ //json objesine döndürmeden başka bir yol gibi..
34
35
  yield this.redis.set(record.key, JSON.stringify(record));
35
36
  return record;
36
37
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@canmertinyo/rate-limit-express",
3
3
  "description": "A simple rate-limiting middleware for Express.js",
4
- "version": "1.3.6",
4
+ "version": "1.3.7",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
7
7
  "types": "dist/index.d.ts",