fix: bypass static index.html serving to allow dynamic header path rewriting
All checks were successful
Build and Push Presejpacky Docker Image / build-and-push (push) Successful in 6s

This commit is contained in:
2026-06-08 00:08:25 +02:00
parent afd29c0a23
commit 16b0568bf1

View File

@@ -30,8 +30,15 @@ app.use((req, res, next) => {
next();
});
// Serve static files from the 'dist' directory
app.use(express.static(path.join(__dirname, 'dist')));
// Serve static files from the 'dist' directory, but bypass index.html requests
// so they can be handled dynamically by our fallback route.
app.use((req, res, next) => {
if (req.url === '/index.html') {
return next();
}
next();
});
app.use(express.static(path.join(__dirname, 'dist'), { index: false }));
// Fallback to index.html for Single Page Application routing, injecting base path from headers
app.get('*', (req, res) => {