From 5c45c098e2674729738c87984c55c9122a94cff9 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Thu, 5 Mar 2026 11:30:21 +0100 Subject: [PATCH] Fix: Express v5 wildcard route, add global error handlers --- server/src/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/src/index.ts b/server/src/index.ts index 0b1aa02..121c097 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -1530,11 +1530,19 @@ app.post('/api/play-url', async (req: Request, res: Response) => { const webDistPath = path.resolve(__dirname, '../../web/dist'); if (fs.existsSync(webDistPath)) { app.use(express.static(webDistPath)); - app.get('*', (_req, res) => { + app.get('/{*splat}', (_req, res) => { res.sendFile(path.join(webDistPath, 'index.html')); }); } +process.on('uncaughtException', (err) => { + console.error(`FATAL uncaughtException:`, err); + process.exit(1); +}); +process.on('unhandledRejection', (reason) => { + console.error(`FATAL unhandledRejection:`, reason); +}); + app.listen(PORT, () => { console.log(`Server läuft auf http://0.0.0.0:${PORT}`);