File size: 459 Bytes
03677d0
 
 
 
 
 
ba62208
 
 
 
1
2
3
4
5
6
7
8
9
10
11
/** 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';
}