Files
schafkop-neu/schafkopf-os/static/app.js
Valentin Heiserer 7493368043 delete back and frontend
add schafkopf os
add build firmware action
2025-10-10 23:01:09 +02:00

26 lines
810 B
JavaScript

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 json = await res.json();
out.textContent = JSON.stringify(json, null, 2);
} catch (err) {
out.textContent = 'Error: ' + (err?.message || String(err));
}
});