From 9fe1eb3a42bb1a1846d1cea706aa4ea56845c74a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Sun, 5 May 2024 21:29:09 +0800 Subject: [PATCH] remove: webui log --- src/webui/index.ts | 16 +++++++++++----- static/{index.html => config.html} | 0 static/login.html | 11 +++++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) rename static/{index.html => config.html} (100%) create mode 100644 static/login.html diff --git a/src/webui/index.ts b/src/webui/index.ts index cf907f74..ccce84ea 100644 --- a/src/webui/index.ts +++ b/src/webui/index.ts @@ -1,12 +1,18 @@ import express from 'express'; import { resolve } from 'node:path'; -const app = express() +const app = express(); +/** + * 初始化并启动WebUI服务。 + * 该函数配置了Express服务器以支持JSON解析和静态文件服务,并监听6099端口。 + * 无需参数。 + * @returns {Promise} 无返回值。 + */ export async function InitWebUi() { - app.use(express.json()) - app.use('/webui', express.static(resolve(__dirname, './static'))) - // 启动WebUi + app.use(express.json()); + // 配置静态文件服务,提供./static目录下的文件服务,访问路径为/webui + app.use('/webui', express.static(resolve(__dirname, './static'))); app.listen(6099, async () => { - console.log(`WebUi is running at IP:6099`) + //console.log(`WebUi is running at IP:6099`); }) } diff --git a/static/index.html b/static/config.html similarity index 100% rename from static/index.html rename to static/config.html diff --git a/static/login.html b/static/login.html new file mode 100644 index 00000000..5661091b --- /dev/null +++ b/static/login.html @@ -0,0 +1,11 @@ + + + + + + NapCat - Login + + + + + \ No newline at end of file