[object Object]

← back to Screenprintedwallpaper

add clean-URL routes for editorial pages, fixing the dead /about nav link (maps to history.html)

a8be562a9f13895568489018a552057b430d99fd · 2026-05-18 20:53:25 -0700 · Steve Abrams

Files touched

Diff

commit a8be562a9f13895568489018a552057b430d99fd
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon May 18 20:53:25 2026 -0700

    add clean-URL routes for editorial pages, fixing the dead /about nav link (maps to history.html)
---
 server.js | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/server.js b/server.js
index 5060737..9196038 100644
--- a/server.js
+++ b/server.js
@@ -125,6 +125,16 @@ app.get('/api/facets', (req, res) => {
 
 app.get('/api/health', (req, res) => res.json({ status: 'ok', count: PRODUCTS_NICHE.length, dropped: DROPPED }));
 
+// Clean-URL routes for the static editorial pages. /about maps to the
+// history page (the nav links to /about, but the page on disk is history.html).
+const CLEAN_PAGES = { '/about': 'history.html', '/history': 'history.html', '/care': 'care.html', '/sourcing': 'sourcing.html', '/trade': 'trade.html', '/vocabulary': 'vocabulary.html' };
+for (const [route, file] of Object.entries(CLEAN_PAGES)) {
+  const abs = path.join(__dirname, 'public', file);
+  if (fs.existsSync(abs)) {
+    app.get(route, (req, res) => res.sendFile(abs));
+  }
+}
+
 app.get('/sample/:handle', (req, res) => {
   const p = PRODUCTS_NICHE.find(x => x.handle === req.params.handle || x.sku === req.params.handle);
   if (!p) return res.status(404).send('Not found');

← 85e1479 fix /api/facets total to report niche-filtered count, not pr  ·  back to Screenprintedwallpaper  ·  untrack 13 .bak snapshot files, ignore *.bak.*/*.pre-*, add 16c275d →