Files
hictoaster/electron-serve.js

22 lines
425 B
JavaScript
Raw Normal View History

2021-11-19 21:59:43 +01:00
const {app, BrowserWindow} = require('electron');
const serve = require('electron-serve');
const loadURL = serve({directory: 'hen'});
let mainWindow;
(async () => {
2021-11-19 22:43:29 +01:00
await app.whenReady();
2021-11-19 21:59:43 +01:00
2021-11-19 22:43:29 +01:00
mainWindow = new BrowserWindow({
width: 1280,
2021-11-20 02:15:47 +01:00
height: 960
2021-11-19 22:43:29 +01:00
});
2021-11-19 21:59:43 +01:00
2021-11-19 22:43:29 +01:00
await loadURL(mainWindow);
2021-11-19 21:59:43 +01:00
2021-11-19 22:43:29 +01:00
// The above is equivalent to this:
await mainWindow.loadURL('app://-');
// The `-` is just the required hostname
2021-11-19 21:59:43 +01:00
})();