DevQueen's picture
Sync from GitHub via hub-sync
1dc2504 verified
Raw
History Blame Contribute Delete
311 Bytes
/** API base URL from Vercel env; empty uses same-origin paths (Vercel rewrites → Render). */
export const API_BASE = (import.meta.env.VITE_API_URL ?? "").replace(/\/$/, "");
export function apiUrl(path) {
const normalized = path.startsWith("/") ? path : `/${path}`;
return `${API_BASE}${normalized}`;
}