From 8bc15951e48f72442f5a6f0c553ab8e56ca0bea9 Mon Sep 17 00:00:00 2001 From: Bastian Gruber Date: Mon, 23 Feb 2026 15:01:04 -0400 Subject: [PATCH] fix: path changes --- web/index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/index.html b/web/index.html index 62f5df9..f0a4231 100644 --- a/web/index.html +++ b/web/index.html @@ -587,11 +587,14 @@ function fmtKcal(n) { return n.toLocaleString(); } +// Base path detection (works under /caltrack/ or /) +const basePath = window.location.pathname.replace(/\/$/, ''); + // Fetch helpers async function api(method, path, body) { const opts = { method, headers: { 'Content-Type': 'application/json' } }; if (body) opts.body = JSON.stringify(body); - const res = await fetch(path, opts); + const res = await fetch(basePath + path, opts); return res.json(); }