1 Commits

Author SHA1 Message Date
16b0568bf1 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
2026-06-08 00:08:25 +02:00

View File

@@ -30,8 +30,15 @@ app.use((req, res, next) => {
next(); next();
}); });
// Serve static files from the 'dist' directory // Serve static files from the 'dist' directory, but bypass index.html requests
app.use(express.static(path.join(__dirname, 'dist'))); // 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 // Fallback to index.html for Single Page Application routing, injecting base path from headers
app.get('*', (req, res) => { app.get('*', (req, res) => {