← back to Saloonwallpaper
Add clean-URL routes for /about /history /care /sourcing /trade
2e072c9d8e6146de095b7cef9488948af17f44b9 · 2026-05-19 08:00:43 -0700 · Steve Abrams
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Files touched
Diff
commit 2e072c9d8e6146de095b7cef9488948af17f44b9
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Tue May 19 08:00:43 2026 -0700
Add clean-URL routes for /about /history /care /sourcing /trade
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 03267fd..b280da8 100644
--- a/server.js
+++ b/server.js
@@ -123,6 +123,19 @@ app.use((req, res, next) => {
if (/\.(bak)(\.|$)|\.pre-/i.test(req.path)) return res.status(404).send('Not found');
next();
});
+
+// Clean-URL routes for extension-less nav links → existing static pages.
+const CLEAN_URLS = {
+ '/about': 'history.html', // "About →" footer link → company history page
+ '/history': 'history.html',
+ '/care': 'care.html',
+ '/sourcing': 'sourcing.html',
+ '/trade': 'trade.html',
+};
+for (const [route, file] of Object.entries(CLEAN_URLS)) {
+ app.get(route, (req, res) => res.sendFile(path.join(__dirname, 'public', file)));
+}
+
app.use(express.static(path.join(__dirname, 'public')));
app.get('/api/products', (req, res) => {
← 79dfea8 Untrack editor snapshot files; broaden .gitignore + add stat
·
back to Saloonwallpaper
·
Add noopener,noreferrer to window.open external nav link f6da570 →