millas 0.2.31 → 0.2.32
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/package.json
CHANGED
package/src/commands/serve.js
CHANGED
|
@@ -178,7 +178,7 @@ const DEFAULT_OPTIONS = {
|
|
|
178
178
|
statusCode: 429,
|
|
179
179
|
keyBy: 'ip', // 'ip' | 'user' | function(req) => string
|
|
180
180
|
store: null, // defaults to MemoryRateLimitStore
|
|
181
|
-
skip:
|
|
181
|
+
skip: req=>true, // optional function(req) => bool — return true to skip
|
|
182
182
|
onLimitReached: null, // optional function(req, res, options) — called on 429
|
|
183
183
|
};
|
|
184
184
|
|
package/src/index.js
CHANGED
|
@@ -3,7 +3,15 @@
|
|
|
3
3
|
const Millas = require('./container/MillasApp');
|
|
4
4
|
const DB = require('./facades/DB');
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @param {import('./types').MillasConfig} config
|
|
8
|
+
* @returns {import('./types').MillasConfig}
|
|
9
|
+
*/
|
|
10
|
+
function defineConfig(config) {
|
|
11
|
+
return config;
|
|
12
|
+
}
|
|
13
|
+
|
|
6
14
|
/**
|
|
7
15
|
* @module millas
|
|
8
16
|
*/
|
|
9
|
-
module.exports = { Millas, DB };
|
|
17
|
+
module.exports = { Millas, DB, defineConfig };
|