guoziyun 3 周之前
父節點
當前提交
c6223a2d7f
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 3 1
      platform/server/dist/index.js
  2. 0 1
      platform/server/dist/index.js.map

+ 3 - 1
platform/server/dist/index.js

@@ -33,7 +33,9 @@ async function main() {
     app.use("/api/v1", (0, builds_1.buildsRouter)(db, STORAGE_DIR, preview_2.onThemeSaved));
     app.use("/api/v1", (0, preview_1.previewRouter)(db, STORAGE_DIR));
     // 构建预览文件(真机扫码测试)
-    app.use("/q", express_1.default.static(path_1.default.join(STORAGE_DIR, "previews")));
+    const previewsDir = path_1.default.join(STORAGE_DIR, "previews");
+    app.use("/q", express_1.default.static(previewsDir));
+    app.use("/q", (_req, res) => res.status(404).send("Preview not found"));
     // 生产环境:serve React 静态文件
     app.use(express_1.default.static(CLIENT_DIST));
     app.get("*", (_req, res) => {

文件差異過大導致無法顯示
+ 0 - 1
platform/server/dist/index.js.map


部分文件因文件數量過多而無法顯示