From 4901a00a7044b536b830125cd03f74b0604705eb Mon Sep 17 00:00:00 2001 From: Gregor Biswanger Date: Fri, 6 Oct 2017 02:15:07 +0200 Subject: [PATCH] remove copy of main.js --- ElectronNET.CLI/ElectronHost/main.js | 59 ---------------------------- 1 file changed, 59 deletions(-) delete mode 100644 ElectronNET.CLI/ElectronHost/main.js diff --git a/ElectronNET.CLI/ElectronHost/main.js b/ElectronNET.CLI/ElectronHost/main.js deleted file mode 100644 index 738ff02..0000000 --- a/ElectronNET.CLI/ElectronHost/main.js +++ /dev/null @@ -1,59 +0,0 @@ -const { app, BrowserWindow, Notification } = require('electron'); -const io = require('socket.io')(3000); -const path = require('path'); - -let window; -let apiProcess; - -app.on('ready', () => { - const process = require('child_process').spawn; - - // run server - // ToDo: The .exe name may vary. The most simple solution would be to locate the first .exe in the given directory - var apipath = path.join(__dirname, '\\bin\\ElectronNET.WebApp.exe /electronized=true'); - apiProcess = process(apipath); - - apiProcess.stdout.on('data', (data) => { - var text = data.toString(); - console.log(`stdout: ${data.toString()}`); - }); -}); - -io.on('connection', (socket) => { - console.log('ASP.NET Core Application connected...'); - - socket.on('createBrowserWindow', (options) => { - console.log(options); - options.show = true; - - window = new BrowserWindow(options); - window.loadURL('http://localhost:5000'); - - window.on('closed', function () { - mainWindow = null; - apiProcess = null; - }); - }); - - socket.on('createNotification', (options) => { - const notification = new Notification(options); - notification.show(); - }); -}); - -// Quit when all windows are closed. -app.on('window-all-closed', () => { - // On macOS it is common for applications and their menu bar - // to stay active until the user quits explicitly with Cmd + Q - if (process.platform !== 'darwin') { - app.quit(); - } -}); - -app.on('activate', () => { - // On macOS it's common to re-create a window in the app when the - // dock icon is clicked and there are no other windows open. - if (win === null) { - createWindow(); - } -}); \ No newline at end of file