ev-grid-oracle / web /src /paths.ts
NITISHRG15102007's picture
sync: push from tools/sync_space_to_hub.py (no artifacts/)
32e1e21 verified
/**
* Vite `base` is `/ui/` in production; static files from `web/public` live under that prefix.
* Demo API routes stay at the site root (`/demo/...`), so do not use this for `/demo/*`.
*/
export function staticAssetUrl(path: string): string {
const base = import.meta.env.BASE_URL;
const b = base.endsWith("/") ? base : `${base}/`;
const p = path.startsWith("/") ? path.slice(1) : path;
return `${b}${p}`;
}