tfrere HF Staff commited on
Commit
ac48bd2
·
1 Parent(s): 755a930

fix: replace undefined __dirname with DATA_DIR in ESM server

Browse files

__dirname was removed during utils.ts extraction but still referenced
in staticDir computation, causing a ReferenceError crash on startup.

Made-with: Cursor

Files changed (1) hide show
  1. backend/src/server.ts +2 -2
backend/src/server.ts CHANGED
@@ -351,8 +351,8 @@ app.use("/published", express.static(join(DATA_DIR, "published")));
351
 
352
  const staticDir =
353
  process.env.NODE_ENV === "production"
354
- ? join(__dirname, "..", "frontend-dist")
355
- : join(__dirname, "..", "..", "frontend", "dist");
356
 
357
  function getPublishedPath(docName: string): string {
358
  return join(DATA_DIR, "published", docName, "index.html");
 
351
 
352
  const staticDir =
353
  process.env.NODE_ENV === "production"
354
+ ? join(DATA_DIR, "..", "frontend-dist")
355
+ : join(DATA_DIR, "..", "..", "frontend", "dist");
356
 
357
  function getPublishedPath(docName: string): string {
358
  return join(DATA_DIR, "published", docName, "index.html");