fix: express 5 wildcard splat

This commit is contained in:
2026-03-14 16:03:08 +00:00
parent e81a0653e3
commit a40436bb88

View File

@@ -75,7 +75,7 @@ app.get('/health', (req, res) => {
const clientPath = path.join(process.cwd(), 'dist', 'client'); const clientPath = path.join(process.cwd(), 'dist', 'client');
if (fs.existsSync(clientPath)) { if (fs.existsSync(clientPath)) {
app.use(express.static(clientPath)); app.use(express.static(clientPath));
app.get('(.*)', (req, res) => { app.get('/:splat*', (req, res) => {
if (!req.path.startsWith('/api') && !req.path.startsWith('/uploads')) { if (!req.path.startsWith('/api') && !req.path.startsWith('/uploads')) {
res.sendFile(path.join(clientPath, 'index.html')); res.sendFile(path.join(clientPath, 'index.html'));
} }