add basic github api

This commit is contained in:
2025-10-10 23:48:52 +02:00
parent e6a57a49f1
commit 730b4c508b
5 changed files with 2219 additions and 17 deletions

View File

@@ -1,22 +1,10 @@
const btn = document.getElementById('pingBtn');
const versionBtn = document.getElementById('versionBtn');
const out = document.getElementById('result');
btn?.addEventListener('click', async () => {
out.textContent = 'Requesting /api/ping…';
try {
const res = await fetch('/api/ping');
const json = await res.json();
out.textContent = JSON.stringify(json, null, 2);
} catch (err) {
out.textContent = 'Error: ' + (err?.message || String(err));
}
});
versionBtn?.addEventListener('click', async () => {
out.textContent = 'Requesting /api/version…';
try {
const res = await fetch('/api/version');
const res = await fetch('/api');
const json = await res.json();
out.textContent = JSON.stringify(json, null, 2);
} catch (err) {