Files
hictoaster/electron-serve.js
Victor Giers a14333e6e6 initial commit
2021-11-19 21:59:43 +01:00

21 lines
383 B
JavaScript

const {app, BrowserWindow} = require('electron');
const serve = require('electron-serve');
const loadURL = serve({directory: 'hen'});
let mainWindow;
(async () => {
await app.whenReady();
mainWindow = new BrowserWindow();
await loadURL(mainWindow);
// The above is equivalent to this:
await mainWindow.loadURL('app://-');
// The `-` is just the required hostname
})();