Update middleware/midware.js
Browse files- middleware/midware.js +3 -1
middleware/midware.js
CHANGED
@@ -24,9 +24,11 @@ const authenticateApiKey = async (req, res, next) => {
|
|
24 |
}
|
25 |
};
|
26 |
|
|
|
|
|
27 |
const apiLimiter = rateLimit({
|
28 |
store: new MongoStore({
|
29 |
-
uri:
|
30 |
collectionName: "rateLimits",
|
31 |
}),
|
32 |
windowMs: 2 * 60 * 1000,
|
|
|
24 |
}
|
25 |
};
|
26 |
|
27 |
+
const dbUrls = `mongodb+srv://${config.USERNAME}:${config.PASSWORD}@cluster0.1asx6h1.mongodb.net/?retryWrites=true&w=majority`
|
28 |
+
|
29 |
const apiLimiter = rateLimit({
|
30 |
store: new MongoStore({
|
31 |
+
uri: dbUrls,
|
32 |
collectionName: "rateLimits",
|
33 |
}),
|
34 |
windowMs: 2 * 60 * 1000,
|