-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
40 lines (32 loc) · 882 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
31
32
33
34
35
36
37
38
39
40
var { app, BrowserWindow } = require('electron');
var url = require('url')
var path = require('path')
var server = require('./server.js');
let win = null;
app.on('ready', () => {
win = new BrowserWindow({
width: 1540,
height: 1000,
webPreferences: {
nativeWindowOpen: true, // add this
nodeIntegration: true,
enableRemoteModule: true
}
})
win.setMenuBarVisibility(false)
win.maximize()
win.loadURL(url.format({
pathname: path.join(__dirname,'dist/ayush-shop/index.html'),
protocol: 'file:',
slashes:true
}));
// 'dist/ayush-shop/index.html'
win.on('closed', () => {
win = null;
})
})
app.on( 'window-all-closed', () => {
if (process.platform != 'darwin') {
app.quit();
}
})