-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
30 lines (27 loc) · 844 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const { app, BrowserWindow } = require('electron')
const express = require('express');
var runUIServer = function () {
var app = express();
app.use(express.static(__dirname + '/webapp')); //__dir and not _dir
var port = 8089; // you can use any port
app.listen(port);
console.log('server on' + port);
}
function createWindow() {
// Create the browser window.
runUIServer();
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
sandbox: true,
webSecurity: false,
nodeIntegration: true
},
icon: "assets\\logo.ico",
})
// and load the index.html of the app.
win.loadURL('http://localhost:8089/');
}
app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors');
app.whenReady().then(createWindow)