← back to build-pages
404: branded page on unknown routes (fleet parity) + 3 smoke
0158ff553964c4cf6b071b7b277899a3179c0523 · 2026-05-13 13:38:42 -0700 · SteveStudio2
Files touched
M server.jsM test/smoke.js
Diff
commit 0158ff553964c4cf6b071b7b277899a3179c0523
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date: Wed May 13 13:38:42 2026 -0700
404: branded page on unknown routes (fleet parity) + 3 smoke
---
server.js | 9 +++++++++
test/smoke.js | 6 ++++++
2 files changed, 15 insertions(+)
diff --git a/server.js b/server.js
index 412d46a..2e39f87 100644
--- a/server.js
+++ b/server.js
@@ -544,6 +544,15 @@ app.get('/api/projects/:slug', async (req, res, next) => {
} catch (e) { next(e); }
});
+// Branded 404 — every other site in the fleet has one, parity matters.
+app.use((req, res) => {
+ res.status(404).send(shell('Not found — build-pages', `
+ <h1>404</h1>
+ <p class="bp-lede">No build journal lives at <code>${esc(req.path)}</code>.</p>
+ <p><a href="/">← back to all projects</a></p>
+ `));
+});
+
app.use((err, _req, res, _next) => {
console.error('[build-pages]', err.message);
res.status(500).send(shell('Error', `<h1>500</h1><pre>${esc(err.message)}</pre>`));
diff --git a/test/smoke.js b/test/smoke.js
index 708d657..59f7ceb 100644
--- a/test/smoke.js
+++ b/test/smoke.js
@@ -140,6 +140,12 @@ function check(name, cond, hint = '') {
check('commits api: 3 returned', /"limit":3/.test(r.body));
check('commits api: hash field', /"hash":"[a-f0-9]{4,}/.test(r.body));
+ // 13. branded 404 on unknown route
+ r = await fetch('/xyz-no-such-route');
+ check('404: status 404', r.status === 404);
+ check('404: branded HTML', /build-pages/.test(r.body));
+ check('404: back-link', /back to all projects/.test(r.body));
+
// Report
if (process.argv.includes('--json')) {
console.log(JSON.stringify({ base: BASE, pass, fail, total: pass + fail, checks, as_of: new Date().toISOString() }));
← 254d1d0 api: /api/projects/:slug/commits — paginated raw JSON (limit
·
back to build-pages
·
api: /api/search?q= — cross-project commit search (min 2 cha eb2ab40 →