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:
@@ -26,7 +26,7 @@
|
|||||||
<FormSettings>
|
<FormSettings>
|
||||||
<Form xsi:type="ItemEdit">
|
<Form xsi:type="ItemEdit">
|
||||||
<DesktopSettings>
|
<DesktopSettings>
|
||||||
<SourceLocation DefaultValue="https://your-redlight-instance.com/outlook-addin/taskpane.html" />
|
<SourceLocation DefaultValue="https://redlight.scrunkly.cat/outlook-addin/taskpane.html" />
|
||||||
<RequestedHeight>600</RequestedHeight>
|
<RequestedHeight>600</RequestedHeight>
|
||||||
</DesktopSettings>
|
</DesktopSettings>
|
||||||
</Form>
|
</Form>
|
||||||
@@ -37,8 +37,7 @@
|
|||||||
<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit" />
|
<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit" />
|
||||||
</Rule>
|
</Rule>
|
||||||
|
|
||||||
<DisableEntityHighlighting>true</DisableEntityHighlighting>
|
<!-- VersionOverrides V1.0 (Desktop) -->
|
||||||
|
|
||||||
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides"
|
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides"
|
||||||
xsi:type="VersionOverridesV1_0">
|
xsi:type="VersionOverridesV1_0">
|
||||||
<Requirements>
|
<Requirements>
|
||||||
@@ -47,6 +46,64 @@
|
|||||||
</bt:Sets>
|
</bt:Sets>
|
||||||
</Requirements>
|
</Requirements>
|
||||||
|
|
||||||
|
<Hosts>
|
||||||
|
<Host xsi:type="MailHost">
|
||||||
|
<DesktopFormFactor>
|
||||||
|
<ExtensionPoint xsi:type="AppointmentOrganizerCommandSurface">
|
||||||
|
<OfficeTab id="TabDefault">
|
||||||
|
<Group id="redlightGroup">
|
||||||
|
<Label resid="groupLabel" />
|
||||||
|
|
||||||
|
<Control xsi:type="Button" id="redlightButton">
|
||||||
|
<Label resid="buttonLabel" />
|
||||||
|
<Supertip>
|
||||||
|
<Title resid="buttonLabel" />
|
||||||
|
<Description resid="buttonDesc" />
|
||||||
|
</Supertip>
|
||||||
|
<Icon>
|
||||||
|
<bt:Image size="16" resid="icon16" />
|
||||||
|
<bt:Image size="32" resid="icon32" />
|
||||||
|
<bt:Image size="80" resid="icon80" />
|
||||||
|
</Icon>
|
||||||
|
<Action xsi:type="ShowTaskpane">
|
||||||
|
<SourceLocation resid="taskpaneUrl" />
|
||||||
|
</Action>
|
||||||
|
</Control>
|
||||||
|
|
||||||
|
</Group>
|
||||||
|
</OfficeTab>
|
||||||
|
</ExtensionPoint>
|
||||||
|
</DesktopFormFactor>
|
||||||
|
</Host>
|
||||||
|
</Hosts>
|
||||||
|
|
||||||
|
<Resources>
|
||||||
|
<bt:Images>
|
||||||
|
<bt:Image id="icon16" DefaultValue="https://redlight.scrunkly.cat/outlook-addin/assets/icon-16.png" />
|
||||||
|
<bt:Image id="icon32" DefaultValue="https://redlight.scrunkly.cat/outlook-addin/assets/icon-32.png" />
|
||||||
|
<bt:Image id="icon80" DefaultValue="https://redlight.scrunkly.cat/outlook-addin/assets/icon-80.png" />
|
||||||
|
</bt:Images>
|
||||||
|
<bt:Urls>
|
||||||
|
<bt:Url id="taskpaneUrl" DefaultValue="https://redlight.scrunkly.cat/outlook-addin/taskpane.html" />
|
||||||
|
</bt:Urls>
|
||||||
|
<bt:ShortStrings>
|
||||||
|
<bt:String id="groupLabel" DefaultValue="Redlight" />
|
||||||
|
<bt:String id="buttonLabel" DefaultValue="Redlight Meeting" />
|
||||||
|
</bt:ShortStrings>
|
||||||
|
<bt:LongStrings>
|
||||||
|
<bt:String id="buttonDesc" DefaultValue="Create or select a Redlight meeting room and insert the join link into this event." />
|
||||||
|
</bt:LongStrings>
|
||||||
|
</Resources>
|
||||||
|
|
||||||
|
<!-- VersionOverrides V1.1 (Mobile) -->
|
||||||
|
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1"
|
||||||
|
xsi:type="VersionOverridesV1_1">
|
||||||
|
<Requirements>
|
||||||
|
<bt:Sets DefaultMinVersion="1.5">
|
||||||
|
<bt:Set Name="Mailbox" />
|
||||||
|
</bt:Sets>
|
||||||
|
</Requirements>
|
||||||
|
|
||||||
<Hosts>
|
<Hosts>
|
||||||
<Host xsi:type="MailHost">
|
<Host xsi:type="MailHost">
|
||||||
<DesktopFormFactor>
|
<DesktopFormFactor>
|
||||||
@@ -76,7 +133,6 @@
|
|||||||
</ExtensionPoint>
|
</ExtensionPoint>
|
||||||
</DesktopFormFactor>
|
</DesktopFormFactor>
|
||||||
|
|
||||||
<!-- Mobile support -->
|
|
||||||
<MobileFormFactor>
|
<MobileFormFactor>
|
||||||
<ExtensionPoint xsi:type="MobileOnlineMeetingCommandSurface">
|
<ExtensionPoint xsi:type="MobileOnlineMeetingCommandSurface">
|
||||||
<Control xsi:type="MobileButton" id="redlightMobileButton">
|
<Control xsi:type="MobileButton" id="redlightMobileButton">
|
||||||
@@ -97,12 +153,12 @@
|
|||||||
|
|
||||||
<Resources>
|
<Resources>
|
||||||
<bt:Images>
|
<bt:Images>
|
||||||
<bt:Image id="icon16" DefaultValue="https://your-redlight-instance.com/outlook-addin/assets/icon-16.png" />
|
<bt:Image id="icon16" DefaultValue="https://redlight.scrunkly.cat/outlook-addin/assets/icon-16.png" />
|
||||||
<bt:Image id="icon32" DefaultValue="https://your-redlight-instance.com/outlook-addin/assets/icon-32.png" />
|
<bt:Image id="icon32" DefaultValue="https://redlight.scrunkly.cat/outlook-addin/assets/icon-32.png" />
|
||||||
<bt:Image id="icon80" DefaultValue="https://your-redlight-instance.com/outlook-addin/assets/icon-80.png" />
|
<bt:Image id="icon80" DefaultValue="https://redlight.scrunkly.cat/outlook-addin/assets/icon-80.png" />
|
||||||
</bt:Images>
|
</bt:Images>
|
||||||
<bt:Urls>
|
<bt:Urls>
|
||||||
<bt:Url id="taskpaneUrl" DefaultValue="https://your-redlight-instance.com/outlook-addin/taskpane.html" />
|
<bt:Url id="taskpaneUrl" DefaultValue="https://redlight.scrunkly.cat/outlook-addin/taskpane.html" />
|
||||||
</bt:Urls>
|
</bt:Urls>
|
||||||
<bt:ShortStrings>
|
<bt:ShortStrings>
|
||||||
<bt:String id="groupLabel" DefaultValue="Redlight" />
|
<bt:String id="groupLabel" DefaultValue="Redlight" />
|
||||||
@@ -112,6 +168,7 @@
|
|||||||
<bt:String id="buttonDesc" DefaultValue="Create or select a Redlight meeting room and insert the join link into this event." />
|
<bt:String id="buttonDesc" DefaultValue="Create or select a Redlight meeting room and insert the join link into this event." />
|
||||||
</bt:LongStrings>
|
</bt:LongStrings>
|
||||||
</Resources>
|
</Resources>
|
||||||
|
</VersionOverrides>
|
||||||
|
|
||||||
</VersionOverrides>
|
</VersionOverrides>
|
||||||
</OfficeApp>
|
</OfficeApp>
|
||||||
|
|||||||
@@ -59,10 +59,15 @@ async function start() {
|
|||||||
app.use('/api/federation', calendarRoutes);
|
app.use('/api/federation', calendarRoutes);
|
||||||
app.get('/.well-known/redlight', wellKnownHandler);
|
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
|
// Serve static files in production
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
app.use(express.static(path.join(__dirname, '..', 'dist')));
|
app.use(express.static(path.join(__dirname, '..', 'dist')));
|
||||||
app.get('*', (req, res) => {
|
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'));
|
res.sendFile(path.join(__dirname, '..', 'dist', 'index.html'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user