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
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m6s
This commit is contained in:
@@ -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'));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user