-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
42 lines (34 loc) · 838 Bytes
/
app.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
41
42
'use strict'
const { app } = require('electron')
const appExpress = require('express')()
const path = require('path')
const url = require('url')
const bodyParser = require('body-parser')
const QueryWindow = require('./windows/controllers/QueryWindow')
appExpress.use(bodyParser.urlencoded({ extended: true }))
class BB {
constructor() {
this.queryWindow = null
}
init() {
this.initBB()
}
initBB() {
app.on('ready', () => {
this.createQueryWindow()
this.queryWindow.loadURL('http://localhost:3000')
this.queryWindow.devTools()
})
app.on('activate', () => {
if (this.queryWindow == null) {
this.createQueryWindow()
} else {
this.queryWindow.show()
}
})
}
createQueryWindow() {
this.queryWindow = new QueryWindow()
}
}
new BB().init()