Add 404 handling for /src/ paths in production environment
This commit is contained in:
@@ -106,6 +106,11 @@ if (IS_PRODUCTION) {
|
||||
if (IS_PRODUCTION && (req.path === '/' || req.path === '/partners')) {
|
||||
return; // Route wurde bereits behandelt
|
||||
}
|
||||
// In Production: /src/ Pfade sollten nicht existieren (404)
|
||||
if (IS_PRODUCTION && req.path.startsWith('/src/')) {
|
||||
res.status(404).send('Not found');
|
||||
return;
|
||||
}
|
||||
// Nur für nicht-API und nicht-static Requests
|
||||
if (!req.path.startsWith('/api') && !req.path.startsWith('/static') && req.path !== '/robots.txt' && req.path !== '/sitemap.xml') {
|
||||
res.sendFile(join(distPath, 'index.html'));
|
||||
|
||||
Reference in New Issue
Block a user