Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions vocs.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { defineConfig, McpSource } from "vocs/config";
const baseUrl = (() => {
if (process.env.VERCEL_ENV === "production")
return `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`;
if (process.env.VERCEL_BRANCH_URL)
return `https://${process.env.VERCEL_BRANCH_URL}`;
if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid pinning preview baseUrl to the commit-specific URL

When VERCEL_ENV !== "production", Vercel previews are reachable through both a branch URL and a commit-specific URL. This line now always sets Vocs' baseUrl from VERCEL_URL, and Vocs uses baseUrl to emit a <base> tag, so anyone opening the branch URL gets a page whose relative requests are rewritten to the commit host instead of the current origin. That means client fetches like fetch("/api/services") in src/data/registry.ts:8 can still fail with the same cross-origin/auth issues on the branch preview—the change only flips which preview hostname works.

Useful? React with 👍 / 👎.

if (process.env.NODE_ENV !== "production") return "http://localhost:5173";
return "";
Expand Down
Loading