Commit 3f2391d7 by liimin

修复服务端 dist 路径少爬一层导致同源静态托管失败,补部署运维指引

1 parent 5d686bc9
...@@ -13,8 +13,9 @@ const app = new Hono(); ...@@ -13,8 +13,9 @@ const app = new Hono();
const PORT = Number(process.env.SERVER_PORT ?? 8787); const PORT = Number(process.env.SERVER_PORT ?? 8787);
// 前端 vite build 产物在仓库根 dist/。生产全栈模式下由本服务同源托管。 // 前端 vite build 产物在仓库根 dist/。生产全栈模式下由本服务同源托管。
// 三层 .. 是本文件所在深度:packages/server/src → 仓库根。少一层就变成 packages/dist,静态永远找不到。
const here = path.dirname(fileURLToPath(import.meta.url)); const here = path.dirname(fileURLToPath(import.meta.url));
const DIST = path.resolve(here, '../../dist'); const DIST = path.resolve(here, '../../../dist');
const MIME: Record<string, string> = { const MIME: Record<string, string> = {
'.html': 'text/html; charset=utf-8', '.html': 'text/html; charset=utf-8',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!