From c0b667de46e84d3ad70255dc1ad4304b305f6a0a Mon Sep 17 00:00:00 2001 From: funjia <13429193897@163.com> Date: Wed, 5 Feb 2025 00:24:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8E=E5=AE=A2=E6=88=B7=E7=AB=AF=E6=97=A0=E6=B3=95=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=88=B0=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server.mts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Server.mts b/Server.mts index 5c7fe22..331e821 100644 --- a/Server.mts +++ b/Server.mts @@ -17,10 +17,6 @@ import koaMount from 'koa-mount'; import ConfigHelper from './ConfigHelper.mjs'; import DBHelper from './DBHelper.mjs'; - -const __dirname = dirname(fileURLToPath( - import.meta.url)); - ConfigHelper.initConfig(); (async () => await DBHelper.init())(); @@ -33,6 +29,9 @@ export default CreateServer * port: 服务端口号 */ function CreateServer(port = 4873) { + const __dirname = dirname(fileURLToPath( + import.meta.url)); + const router = new getRouter(); const app = new Koa(); app.use(koaBody());