fix(frontend): keep browser API on same-origin rewrites in dev

Document that NEXT_PUBLIC_WAVELET_BACKEND_URL must stay unset for local
next dev so axios hits /api/* and Next rewrites proxy to the backend.
This commit is contained in:
ryan
2026-07-24 16:37:24 +08:00
parent a4588b05e0
commit 9f15f42b47
75 changed files with 5971 additions and 2450 deletions
+7 -2
View File
@@ -1,11 +1,16 @@
# 前端 URL
WAVELET_FRONTEND_URL=http://localhost:3000
# 后端 URL
# 后端 URL(服务端与 next.config rewrites 使用,不会暴露到浏览器)
WAVELET_BACKEND_URL=http://localhost:8000
# 浏览器侧 API base URL
# - 本地 `pnpm dev`:务必留空或不设置,请求走同源 `/api/*`,由 Next rewrites 反代到 WAVELET_BACKEND_URL
# - 静态导出 / 浏览器需直连后端(如部分 WebSocket 场景)时再设置,例如:
# NEXT_PUBLIC_WAVELET_BACKEND_URL=http://localhost:8000
# Session Cookie
WAVELET_SESSION_COOKIE_NAME=wavelet_session_id
# 环境
NODE_ENV=production
NODE_ENV=development