From 67a418129b05e0a0fc9072619b3531f219139a9c Mon Sep 17 00:00:00 2001 From: yu <191972707@qq.com> Date: Wed, 28 Oct 2026 17:12:10 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=96=B0=E5=A2=9E=E7=BD=91=E9=A1=B5?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E6=BC=94=E7=BB=83=E5=9C=BA=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=B8=8E=E4=B8=89=E9=A1=B9=E7=BD=91=E9=A1=B5=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E6=B5=8B=E8=AF=95=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/fixture/components.html | 44 +++++++++++++++++++++++++++++++ src/main/fixture/server.ts | 7 +++++ 2 files changed, 51 insertions(+) create mode 100644 resources/fixture/components.html diff --git a/resources/fixture/components.html b/resources/fixture/components.html new file mode 100644 index 0000000..41c25b0 --- /dev/null +++ b/resources/fixture/components.html @@ -0,0 +1,44 @@ + + +网页元素演练场 + + +

网页元素演练场

+
+

基础表单

+

+

+

+ + +

+ + +
等待提交…
+
+
+

属性测试

+
属性目标元素

+ +
+
悬停我变色
+
+
页底区域(滚动测试目标)
+ \ No newline at end of file diff --git a/src/main/fixture/server.ts b/src/main/fixture/server.ts index 893a66b..76bb5a6 100644 --- a/src/main/fixture/server.ts +++ b/src/main/fixture/server.ts @@ -28,6 +28,13 @@ export async function startFixtureServer(preferredPort = 17863): Promise return; } if (url.pathname !== "/" && url.pathname !== "/index.html") { + const safe = path.basename(url.pathname); + const file = path.join(root, safe); + if (/\.(html|css|js|png|jpg|svg)$/i.test(safe) && fs.existsSync(file)) { + response.writeHead(200, { "Content-Type": safe.endsWith(".html") ? "text/html; charset=utf-8" : "application/octet-stream", "Cache-Control": "no-store" }); + fs.createReadStream(file).pipe(response); + return; + } response.writeHead(404).end("Not found"); return; }