fix: use Express 5 compatible catch-all route syntax

Change SPA fallback from app.get('*') to app.get('/{*splat}')
as Express 5 uses path-to-regexp v8+ which requires named splat.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel 2026-03-05 23:39:35 +01:00
parent db55d41eee
commit 1669af1e91

View file

@ -100,7 +100,8 @@ async function boot(): Promise<void> {
} }
// SPA Fallback (MUST be after plugin routes) // SPA Fallback (MUST be after plugin routes)
app.get('*', (_req, res) => { // Express 5 uses path-to-regexp v8+ which requires named splat syntax
app.get('/{*splat}', (_req, res) => {
res.sendFile(path.join(import.meta.dirname ?? __dirname, '..', '..', 'web', 'dist', 'index.html')); res.sendFile(path.join(import.meta.dirname ?? __dirname, '..', '..', 'web', 'dist', 'index.html'));
}); });