export const API_BASE_URL = (process.env.API_BASE_URL ?? process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://127.0.0.1:8000")?.replace(/\/+$/, ""); export function apiUrl(path: string): string { if (!path.startsWith("/")) return `${API_BASE_URL}/${path}`; return `${API_BASE_URL}${path}`; }