diff --git a/server/package.json b/server/package.json index e263811..c75c506 100644 --- a/server/package.json +++ b/server/package.json @@ -15,7 +15,7 @@ "@discordjs/voice": "^0.19.0", "cors": "^2.8.5", "discord.js": "^14.25.1", - "express": "^4.19.2", + "express": "^5.2.1", "libsodium-wrappers": "^0.8.2", "multer": "^2.0.0", "sodium-native": "^4.0.8", @@ -24,7 +24,7 @@ }, "devDependencies": { "@types/cors": "^2.8.17", - "@types/express": "^4.17.21", + "@types/express": "^5.0.6", "@types/multer": "^1.4.12", "@types/node": "^20.12.12", "ts-node": "^10.9.2", 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}`);