[object Object]

← back to Restorationwallpaper

Add clean-URL routes for extension-less nav pages

bee78b754a7c09abedba74d4c5edaafb311ef902 · 2026-05-19 07:56:58 -0700 · Steve Abrams

/about (the nav 'About' link, previously 404) now resolves to the
'A short history' page; /care /history /sourcing /trade /vocabulary
also get clean-URL routes mapping to their public/*.html files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit bee78b754a7c09abedba74d4c5edaafb311ef902
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue May 19 07:56:58 2026 -0700

    Add clean-URL routes for extension-less nav pages
    
    /about (the nav 'About' link, previously 404) now resolves to the
    'A short history' page; /care /history /sourcing /trade /vocabulary
    also get clean-URL routes mapping to their public/*.html files.
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---
 server.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/server.js b/server.js
index 219f7c5..439794d 100644
--- a/server.js
+++ b/server.js
@@ -125,6 +125,19 @@ app.use((req, res, next) => {
 });
 app.use(express.static(path.join(__dirname, 'public')));
 
+// Clean-URL routes for extension-less nav links — map to existing public/*.html.
+const CLEAN_PAGES = {
+  '/care': 'care.html',
+  '/history': 'history.html',
+  '/sourcing': 'sourcing.html',
+  '/trade': 'trade.html',
+  '/vocabulary': 'vocabulary.html',
+  '/about': 'history.html', // "A short history" doubles as the About page
+};
+for (const [route, file] of Object.entries(CLEAN_PAGES)) {
+  app.get(route, (req, res) => res.sendFile(path.join(__dirname, 'public', file)));
+}
+
 app.get('/api/products', (req, res) => {
   const { q, aesthetic, vendor, page = 1, limit = 24, sort = 'newest'} = req.query;
   let list = PRODUCTS;

← a0100f1 Untrack editor snapshot files + guard .bak/.pre- from static  ·  back to Restorationwallpaper  ·  stage2: wire microsite catalog + admin CRUD + grid/list view 2712372 →