Fix: Prevent src/public from overriding frontend dist on root path
This commit is contained in:
@@ -125,8 +125,11 @@ app.updateCorsSettings = updateCorsFromSettings;
|
|||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.use(express.urlencoded({ extended: true }));
|
app.use(express.urlencoded({ extended: true }));
|
||||||
|
|
||||||
// Serve static files (landing page)
|
// Serve static files (landing page) - but only for specific paths
|
||||||
app.use(express.static('src/public'));
|
// 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)
|
// Serve frontend build files (if exists, for production)
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|||||||
Reference in New Issue
Block a user