Moved settings.js to ts.

This commit is contained in:
SamTV12345 2024-02-21 21:48:51 +01:00
parent 71c74bc633
commit fbf8667019
44 changed files with 852 additions and 760 deletions

View file

@ -3,7 +3,7 @@
import {ArgsExpressType} from "../../types/ArgsExpressType";
const hasPadAccess = require('../../padaccess');
import {exportAvailable, importExportRateLimiting} from '../../utils/Settings';
import {exportAvailable, settings} from '../../utils/Settings';
const exportHandler = require('../../handler/ExportHandler');
const importHandler = require('../../handler/ImportHandler');
const padManager = require('../../db/PadManager');
@ -14,7 +14,7 @@ const webaccess = require('./webaccess');
exports.expressCreateServer = (hookName:string, args:ArgsExpressType, cb:Function) => {
const limiter = rateLimit({
...importExportRateLimiting,
...settings.importExportRateLimiting,
handler: (request:any) => {
if (request.rateLimit.current === request.rateLimit.limit + 1) {
// when the rate limiter triggers, write a warning in the logs