AkurAI Build
Menu

Public repository / 3ad787ae157fc60f711c536c1811b3b199b0ac1a

AkurAI-Framework / crates/cli/assets/app.js

Latest change 3ad787ae157fc60f711c536c1811b3b199b0ac1a - init: AkurAI-Framework foundation (history reset after FS corruption) by Ólafur Búi Ólafsson

// Native ES module — served and executed by the browser as-is (no bundler).
// Client-first: the page renders itself and pings the server's health endpoint.

const statusEl = document.getElementById("status");

async function checkHealth() {
  try {
    const res = await fetch("/api/health", { headers: { accept: "application/json" } });
    if (!res.ok) throw new Error(`status ${res.status}`);
    const data = await res.json();
    statusEl.textContent = `server up · ${data.framework} v${data.version}`;
    statusEl.classList.add("ok");
  } catch (err) {
    statusEl.textContent = `server unreachable: ${err.message}`;
  }
}

checkHealth();