ouroboros / source /src /api.ts
REXWind's picture
Publish the Ouroboros scientific showcase to CladeTeam
ba62208 verified
Raw History Blame Contribute Delete
459 Bytes
/** Static hosting can point API requests at the existing inference service. */
export function apiUrl(path: string): string {
if (!path.startsWith('/api/')) return path;
const base = document.querySelector<HTMLMetaElement>('meta[name="ouroboros-api-base"]')?.content || '';
return base.replace(/\/+$/, '') + path;
}
export function atlasPath(): string {
return document.querySelector('meta[name="ouroboros-api-base"]') ? '/atlas.html' : '/atlas';
}