Fix: Add Express route for assets to handle BOSA catch-all routing

This commit is contained in:
mmabdalla 2025-12-29 10:00:42 +02:00
parent 95801c09f5
commit 165f8df467

View file

@ -83,6 +83,9 @@ app.get('/preview/:id', previewPage);
// The base path in Vite config ensures assets are referenced as /bp_wb/assets/* // The base path in Vite config ensures assets are referenced as /bp_wb/assets/*
app.use('/assets', express.static(path.join(__dirname, 'dist', 'assets'))); app.use('/assets', express.static(path.join(__dirname, 'dist', 'assets')));
// Also handle assets with parameterized route (for BOSA catch-all routing)
app.get('/assets/:filepath', serveAssets);
// Handler function for manifest route (BOSA calls this) // Handler function for manifest route (BOSA calls this)
async function serveAssets(req, res) { async function serveAssets(req, res) {
const filepath = req.params.filepath || req.path.replace('/assets/', ''); const filepath = req.params.filepath || req.path.replace('/assets/', '');