18 lines
415 B
JavaScript
18 lines
415 B
JavaScript
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 };
|
||
|
|
}
|