Fix: Prevent src/public from overriding frontend dist on root path

This commit is contained in:
salvacybersec
2025-11-11 06:16:17 +03:00
parent 431e0a17ed
commit 859a656032

View File

@@ -125,8 +125,11 @@ app.updateCorsSettings = updateCorsFromSettings;
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
// Serve static files (landing page)
// Serve static files (landing page) - but only for specific paths
// Don't serve from public if frontend dist exists (to avoid conflicts)
if (!fs.existsSync(frontendDistPath)) {
app.use(express.static('src/public'));
}
// Serve frontend build files (if exists, for production)
const path = require('path');