increase rate limit when testing
parent
24067317c9
commit
9a955ce852
3
app.js
3
app.js
|
|
@ -28,6 +28,7 @@ import * as databaseInitializer from './helpers/initializer.database.js';
|
||||||
import { apiGetHandler } from './handlers/permissions.js';
|
import { apiGetHandler } from './handlers/permissions.js';
|
||||||
import { getSafeRedirectURL } from './helpers/functions.authentication.js';
|
import { getSafeRedirectURL } from './helpers/functions.authentication.js';
|
||||||
import debug from 'debug';
|
import debug from 'debug';
|
||||||
|
import { useTestDatabases } from './data/databasePaths.js';
|
||||||
const debugApp = debug('lot-occupancy-system:app');
|
const debugApp = debug('lot-occupancy-system:app');
|
||||||
databaseInitializer.initializeDatabase();
|
databaseInitializer.initializeDatabase();
|
||||||
const _dirname = '.';
|
const _dirname = '.';
|
||||||
|
|
@ -55,7 +56,7 @@ app.use(csurf({
|
||||||
}));
|
}));
|
||||||
app.use(rateLimit({
|
app.use(rateLimit({
|
||||||
windowMs: 10000,
|
windowMs: 10000,
|
||||||
max: 200
|
max: useTestDatabases ? 1000000 : 200
|
||||||
}));
|
}));
|
||||||
const urlPrefix = configFunctions.getProperty('reverseProxy.urlPrefix');
|
const urlPrefix = configFunctions.getProperty('reverseProxy.urlPrefix');
|
||||||
if (urlPrefix !== '') {
|
if (urlPrefix !== '') {
|
||||||
|
|
|
||||||
3
app.ts
3
app.ts
|
|
@ -36,6 +36,7 @@ import { apiGetHandler } from './handlers/permissions.js'
|
||||||
import { getSafeRedirectURL } from './helpers/functions.authentication.js'
|
import { getSafeRedirectURL } from './helpers/functions.authentication.js'
|
||||||
|
|
||||||
import debug from 'debug'
|
import debug from 'debug'
|
||||||
|
import { useTestDatabases } from './data/databasePaths.js'
|
||||||
const debugApp = debug('lot-occupancy-system:app')
|
const debugApp = debug('lot-occupancy-system:app')
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -93,7 +94,7 @@ app.use(
|
||||||
app.use(
|
app.use(
|
||||||
rateLimit({
|
rateLimit({
|
||||||
windowMs: 10_000,
|
windowMs: 10_000,
|
||||||
max: 200
|
max: useTestDatabases ? 1_000_000 : 200
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue