Adjusted origin

This commit is contained in:
Luke Hagar
2024-03-11 11:14:20 -05:00
parent 5ed105bd09
commit 1006c9fd3e
2 changed files with 11 additions and 6 deletions

View File

@@ -0,0 +1,5 @@
---
"adapter-electron": patch
---
Adjusted local address origin for compatibility

View File

@@ -11,8 +11,8 @@ export const start = async () => {
log.info(`Configured Port is: ${port}`);
log.info(`Setting origin to http://127.0.0.1:${port}`);
process.env['ORIGIN'] = `http://127.0.0.1:${port}`;
log.info(`Setting origin to http://localhost:${port}`);
process.env['ORIGIN'] = `http://localhost:${port}`;
log.info('Importing Polka handler');
const { handler } = await import(`file://${path.join(__dirname, '../renderer/handler.js')}`);
@@ -23,8 +23,8 @@ export const start = async () => {
Object.assign(console, log.functions);
log.info('Starting server...');
server.listen({ path: false, host: '127.0.0.1', port }, () => {
log.info(`Server Listening on http://127.0.0.1:${port}`);
server.listen({ path: false, host: 'localhost', port }, () => {
log.info(`Server Listening on http://localhost:${port}`);
});
return port;
@@ -36,7 +36,7 @@ export const load = (mainWindow, port) => {
log.info(`Loading url: ${process.env['ELECTRON_RENDERER_URL']}`);
mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL']);
} else {
log.info(`Loading url: http://127.0.0.1:${port}`);
mainWindow.loadURL(`http://127.0.0.1:${port}`);
log.info(`Loading url: http://localhost:${port}`);
mainWindow.loadURL(`http://localhost:${port}`);
}
};