mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat(server): expose the api rate limit to the env vars
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import dotenv from 'dotenv';
|
||||
import path from 'path';
|
||||
import { toInteger } from 'lodash';
|
||||
import { castCommaListEnvVarToArray, parseBoolean } from '@/utils';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const API_RATE_LIMIT = process.env.API_RATE_LIMIT?.split(',') || [];
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Your favorite port
|
||||
@@ -97,7 +100,7 @@ module.exports = {
|
||||
jwtSecret: process.env.JWT_SECRET,
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
resetPasswordSeconds: 600,
|
||||
|
||||
@@ -130,9 +133,9 @@ module.exports = {
|
||||
blockDuration: 60 * 15,
|
||||
},
|
||||
requests: {
|
||||
points: 60,
|
||||
duration: 60,
|
||||
blockDuration: 60 * 10,
|
||||
points: API_RATE_LIMIT[0] ? toInteger(API_RATE_LIMIT[0]) : 120,
|
||||
duration: API_RATE_LIMIT[1] ? toInteger(API_RATE_LIMIT[1]) : 60,
|
||||
blockDuration: API_RATE_LIMIT[2] ? toInteger(API_RATE_LIMIT[2]) : 60 * 10,
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user