Skip to content

Commit 04ec76e

Browse files
fix(docs): BACKEND_URL fallback 改为生产地址,修复 Vercel SSR resolve 失败
Vercel 运行时若未配置 BACKEND_URL 环境变量,之前 fallback 到 http://localhost:8080 导致 resolve 请求连不上后端,降级到 notFound() 仍返回 404,服务端 308 不生效。 改为 fallback 到 https://api.involutionhell.com,Vercel 节点可直接 到达生产后端,resolve 正常工作。 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 6af9621 commit 04ec76e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/[locale]/docs/[...slug]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import { DocShareButton } from "@/app/components/DocShareButton";
2424
import { routing } from "@/i18n/routing";
2525
import { type PageData } from "@/app/types/doc";
2626

27-
const BACKEND_URL = process.env.BACKEND_URL ?? "http://localhost:8080";
27+
// 优先用 BACKEND_URL(本地开发/Vercel 配置),兜底用生产地址避免 localhost 连不上
28+
const BACKEND_URL = process.env.BACKEND_URL ?? "https://api.involutionhell.com";
2829

2930
/**
3031
* 查询后端 resolve 端点,未知路径可能是历史重命名路径。

0 commit comments

Comments
 (0)