first commit
This commit is contained in:
31
src/main/app.ts
Normal file
31
src/main/app.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { app, BrowserWindow } from 'electron'
|
||||
import { join } from "path"
|
||||
|
||||
const URL = (process.env.NODE_ENV === 'development') ? 'http://localhost:3000/' : 'gnss.cesium.hwasmart.com'
|
||||
|
||||
function createWindow() {
|
||||
const win = new BrowserWindow({
|
||||
fullscreen: true,
|
||||
frame: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
preload: join(__dirname, 'preload.js')
|
||||
}
|
||||
})
|
||||
|
||||
win.loadURL(URL)
|
||||
}
|
||||
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user