fix(server): enable clean URLs (/whitepapers/foo → foo.html)

Add extensions: ['html'] to express.static so the .html-less URLs resolve
to their matching files. Affects every static HTML route including
/whitepapers/distributive-equity, /whitepapers/eu-policy-brief, etc.

.html-suffixed URLs continue to work unchanged. Non-existent paths still
return the friendly 404 via the notFound middleware.
This commit is contained in:
TheFlow 2026-04-18 07:41:29 +12:00
parent 2480d73d6f
commit f6be654573

View file

@ -135,7 +135,9 @@ const rssRoutes = require('./routes/rss.routes');
app.use('/', rssRoutes);
// Static files
app.use(express.static('public'));
// extensions: ['html'] lets clean URLs (e.g. /whitepapers/eu-policy-brief) resolve
// to the matching .html file. Without this, only the .html-suffixed URL works.
app.use(express.static('public', { extensions: ['html'] }));
// Health check endpoint (minimal, no sensitive data)
app.get('/health', (req, res) => {