const { app, ipcMain, BrowserWindow } = require('electron'); const path = require('path'); const http = require('http'); function createWindow () { const mainWindow = new BrowserWindow({ webPreferences: { webSecurity: false, preload: path.join(__dirname, 'preload.js') } }); mainWindow.loadFile('index.html'); mainWindow.webContents.on('render-process-gone', () => { process.exit(1); }); } const server = http.createServer((_req, res) => { res.end('