Files
CollabTable/CollabTableServer/webui/src/lib/api.js
T

18 lines
415 B
JavaScript
Raw Normal View History

async function getJson(url) {
const res = await fetch(url, { cache: 'no-store' });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.json();
}
export async function fetchOverview() {
return getJson('/web/data');
}
export async function fetchTechStack() {
return getJson('/web/info');
}
export async function fetchHealth() {
const res = await fetch('/health');
return { up: res.ok };
}