setup electron app for production

This commit is contained in:
talksik
2026-04-13 10:03:23 -07:00
parent 1579de8c6d
commit 106254ef83
13 changed files with 96 additions and 21 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ import started from 'electron-squirrel-startup';
import { updateElectronApp, UpdateSourceType } from 'update-electron-app';
import type { LinkMetadata } from './lib/link-metadata';
import { appConfig } from './config/env';
if (app.isPackaged) {
updateElectronApp({
@@ -484,7 +485,7 @@ app.on('ready', () => {
// The server doesn't handle OPTIONS preflight, so we intercept at the
// Electron network layer: inject CORS headers and return 200 for preflight.
session.defaultSession.webRequest.onHeadersReceived(
{ urls: ['https://orion.dev.flowy.live/*', 'https://storage.googleapis.com/*'] },
{ urls: [`${appConfig.orionUrl}/*`, 'https://storage.googleapis.com/*'] },
(details, callback) => {
const headers = { ...details.responseHeaders };
headers['access-control-allow-origin'] = ['*'];