Breakthrough change

This commit is contained in:
2026-11-14 22:12:04 +07:00
parent 65908617c3
commit 1a4774e376
12 changed files with 806 additions and 116 deletions
@@ -102,17 +102,29 @@
</main>
<script>
const HEALTH_URL = "http://localhost:3000/api/v1/system/health-check/";
const FE_URL = "http://localhost:3000/";
async function checkBackend() {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 2500);
try {
const res = await fetch(
"http://localhost:3000/api/v1/health-check/",
{ mode: "no-cors" },
);
window.location.href = "http://localhost:3000/";
const res = await fetch(`${HEALTH_URL}?t=${Date.now()}`, {
signal: controller.signal,
});
clearTimeout(timeoutId);
if (res.ok) {
window.location.replace(FE_URL);
return;
}
} catch (e) {
setTimeout(checkBackend, 3000);
clearTimeout(timeoutId);
}
setTimeout(checkBackend, 2000);
}
setTimeout(checkBackend, 1000);
</script>
</body>