From 7a4f0d91f31c8094ebe78cc37d8ea1dd87ca1367 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Aug 2026 21:23:54 +0200 Subject: [PATCH] Pretty URL for the dashboard: /status -> /status.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The documented URL did not work, and failed in the most misleading way possible: PocketBase's indexFallback (on by default) serves index.html for any unmatched static path, so /status returned the family landing page with HTTP 200. It looked like the dashboard had silently broken rather than like a missing route. Follows the existing /settings -> /settings.html pattern in settings.pb.js, which is presumably why that one has always worked. Validated on a clean boot with hooksWatch off: 302 to /status.html, the page titled 'Amber - stav služeb', /api/status still 401, no JS errors. --- pb_hooks/status.pb.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pb_hooks/status.pb.js b/pb_hooks/status.pb.js index 2955a99..e04726f 100644 --- a/pb_hooks/status.pb.js +++ b/pb_hooks/status.pb.js @@ -32,6 +32,14 @@ // anything a handler needs must be declared INSIDE it — file-scope helpers throw // ReferenceError at request time. Nothing is hoisted here; keep it that way. +// Pretty URL, following the same pattern as /settings → /settings.html. +// +// Without it, `/status` does NOT 404 — PocketBase's `indexFallback` (on by +// default) quietly serves index.html for any unmatched static path, so the URL +// looked like it worked and returned the family landing page instead. The docs +// were written with the pretty URL, so the docs were wrong until this existed. +routerAdd("GET", "/status", (e) => e.redirect(302, "/status.html")) + routerAdd("GET", "/api/status", (e) => { // ---- helpers, all handler-local (isolated JSVM) ------------------------ const safe = (label, fn) => {