Nodejs-JSON-API-Server / src /config /runtime-config.js
dangkhoa2016's picture
feat: add runtime configuration for rate limiting and Redis
e9d5bbe
Raw History Blame Contribute Delete
322 Bytes
'use strict';
const store = new Map([
['rateLimitEnabled', true],
['rateLimitMax', 100],
['rateLimitWindowMs', 60000],
['rateLimitWindowSec', 60],
]);
const runtimeConfig = {
get(key) {
return store.get(key);
},
set(key, value) {
store.set(key, value);
},
};
module.exports = { runtimeConfig };