server: remove slow option

This commit is contained in:
Johann150 2024-10-10 11:34:29 +02:00
parent 67ebf83ed7
commit b63e03942e
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1
5 changed files with 0 additions and 32 deletions

View file

@ -1,8 +0,0 @@
{
"node-option": [
"experimental-specifier-resolution=node"
],
"slow": 1000,
"timeout": 30000,
"exit": true
}

View file

@ -62,7 +62,6 @@
"koa-logger": "3.2.1",
"koa-mount": "4.0.0",
"koa-send": "5.0.1",
"koa-slow": "2.1.0",
"koa-views": "7.0.2",
"mfm-js": "0.23.3",
"mime-types": "2.1.35",

View file

@ -1,14 +0,0 @@
declare module 'koa-slow' {
import { Middleware } from 'koa';
interface ISlowOptions {
url?: RegExp;
delay?: number;
}
function slow(options?: ISlowOptions): Middleware;
namespace slow {} // Hack
export = slow;
}

View file

@ -13,7 +13,6 @@ export const envOption = {
noDaemons: false,
disableClustering: false,
withLogTime: false,
slow: false,
logLevel: LOG_LEVELS.info,
};

View file

@ -9,7 +9,6 @@ import Koa from 'koa';
import Router from '@koa/router';
import mount from 'koa-mount';
import koaLogger from 'koa-logger';
import * as slow from 'koa-slow';
import { IsNull } from 'typeorm';
import config from '@/config/index.js';
@ -40,13 +39,6 @@ if (!['production', 'test'].includes(process.env.NODE_ENV || '')) {
app.use(koaLogger(str => {
serverLogger.info(str);
}));
// Delay
if (envOption.slow) {
app.use(slow({
delay: 3000,
}));
}
}
// HSTS