guoziyun 3 settimane fa
parent
commit
c6223a2d7f
2 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  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) => {

File diff suppressed because it is too large
+ 0 - 1
platform/server/dist/index.js.map


Some files were not shown because too many files changed in this diff