removed express static fallback

This commit is contained in:
2025-10-23 00:39:28 +02:00
parent 5c7786bc19
commit d78ba474d8

View File

@@ -41,11 +41,6 @@ app.get('/api/health', (req: any, res: any) => {
// 🆕 STATIC FILE SERVING FÜR FRONTEND // 🆕 STATIC FILE SERVING FÜR FRONTEND
app.use(express.static(path.join(__dirname, '../../frontend-build'))); app.use(express.static(path.join(__dirname, '../../frontend-build')));
// 🆕 FALLBACK FÜR CLIENT-SIDE ROUTING
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, '../../frontend-build/index.html'));
});
// Error handling middleware // Error handling middleware
app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => { app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => {
console.error('Unhandled error:', err); console.error('Unhandled error:', err);