[object Object]

← back to Resume Queue Viewer

404 unknown routes instead of serving the page on every URL

3609a67f586889f29b66434d67a1287cd8715097 · 2026-05-18 20:07:23 -0700 · SteveStudio2

Files touched

Diff

commit 3609a67f586889f29b66434d67a1287cd8715097
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Mon May 18 20:07:23 2026 -0700

    404 unknown routes instead of serving the page on every URL
---
 server.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/server.js b/server.js
index 77e81ec..624a02a 100644
--- a/server.js
+++ b/server.js
@@ -405,8 +405,16 @@ const server = http.createServer((req, res) => {
   }
 
   if (req.url === '/healthz') { res.writeHead(200); res.end('ok'); return; }
-  res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
-  res.end(PAGE);
+
+  if (req.url === '/' || req.url === '/index.html') {
+    res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
+    res.end(PAGE);
+    return;
+  }
+
+  // Anything else is genuinely not found — don't masquerade as the page.
+  res.writeHead(404, { 'Content-Type': 'text/plain; charset=utf-8' });
+  res.end('404 — not found');
 });
 
 server.listen(PORT, '127.0.0.1', () => {

← 620dc5f Refactor: extract readBody + sendJSON helpers, DRY out POST  ·  back to Resume Queue Viewer  ·  Add manual Refresh button with reload toast 37e1152 →