mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-26 19:44:51 +02:00
12 lines
295 B
JavaScript
12 lines
295 B
JavaScript
const { contextBridge, ipcRenderer } = require('electron');
|
|
|
|
(async () => {
|
|
const port = await ipcRenderer.invoke('get-backend-port');
|
|
|
|
contextBridge.exposeInMainWorld('__OPENSWARM_PORT__', port);
|
|
|
|
contextBridge.exposeInMainWorld('openswarm', {
|
|
getBackendPort: () => port,
|
|
});
|
|
})();
|