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) => {