Some checks failed
CI / build-check-test (push) Has been cancelled
Restructure local extensions into per-feature directories, split WebUI into backend modules with slash commands and systemd support, and track prompts/skills under .pi/agent for portable Gitea deployment. Co-authored-by: Cursor <cursoragent@cursor.com>
14 lines
420 B
TypeScript
14 lines
420 B
TypeScript
const API_BASE = (import.meta.env.VITE_API_BASE ?? "").trim().replace(/\/$/, "");
|
|
|
|
/** Resolve an API path. Empty base keeps same-origin relative paths for web `dist/`. */
|
|
export function apiUrl(path: string): string {
|
|
if (!path.startsWith("/")) {
|
|
throw new Error(`API path must start with /: ${path}`);
|
|
}
|
|
return API_BASE ? `${API_BASE}${path}` : path;
|
|
}
|
|
|
|
export function getApiBase(): string {
|
|
return API_BASE;
|
|
}
|