Files
go-service/cmd/server/web/dist/data.js

13 lines
328 B
JavaScript

export async function fetchHealth() {
const r = await fetch("/api/health");
if (!r.ok)
throw new Error(`HTTP ${r.status}`);
return r.json();
}
export async function fetchHistory() {
const r = await fetch("/api/history");
if (!r.ok)
throw new Error(`HTTP ${r.status}`);
return r.json();
}