feat(outlook-addin): serve static files and prevent SPA routing for add-in paths
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m6s

This commit is contained in:
2026-03-02 11:31:56 +01:00
parent 13c60ba052
commit af7540eb8c
2 changed files with 86 additions and 24 deletions

View File

@@ -59,10 +59,15 @@ async function start() {
app.use('/api/federation', calendarRoutes);
app.get('/.well-known/redlight', wellKnownHandler);
// Serve Outlook Add-in static files (before SPA catch-all)
app.use('/outlook-addin', express.static(path.join(__dirname, '..', 'outlook-addin')));
// Serve static files in production
if (process.env.NODE_ENV === 'production') {
app.use(express.static(path.join(__dirname, '..', 'dist')));
app.get('*', (req, res) => {
// Don't serve SPA for outlook-addin paths
if (req.path.startsWith('/outlook-addin')) return res.status(404).end();
res.sendFile(path.join(__dirname, '..', 'dist', 'index.html'));
});
}