From 859a656032086e75a7264404d47f6cf6ab7c7ec3 Mon Sep 17 00:00:00 2001 From: salvacybersec Date: Tue, 11 Nov 2025 06:16:17 +0300 Subject: [PATCH] Fix: Prevent src/public from overriding frontend dist on root path --- backend/src/app.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/app.js b/backend/src/app.js index cfa0bdc..22123fe 100644 --- a/backend/src/app.js +++ b/backend/src/app.js @@ -125,8 +125,11 @@ app.updateCorsSettings = updateCorsFromSettings; app.use(express.json()); app.use(express.urlencoded({ extended: true })); -// Serve static files (landing page) -app.use(express.static('src/public')); +// 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');