claude/skills/web-project-scaffold-containerized-python/templates/project/app/static/js/main.js
Neil Bantoc 5201aa9bd5 Add web-frontend, web-project-audit and web-project-scaffold-containerized-python skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 16:26:33 -08:00

15 lines
537 B
JavaScript

// Plain ES modules, no bundler. Vendor any library into /static/vendor and import it by path.
import { getJSON } from "./api.js";
const status = document.getElementById("status");
const version = document.getElementById("version");
try {
const info = await getJSON("/api/info");
version.textContent = info.version;
status.textContent = `Running ${info.name} at commit ${info.version}.`;
status.className = "ok";
} catch (err) {
status.textContent = `Could not reach the API: ${err.message}`;
status.className = "error";
}