Update main.js

Add an IPC handler
main
Nazım Gediz Aydındoğmuş 2 years ago
parent 6f083b80d9
commit 8747b875f1

@ -1,5 +1,5 @@
// Importing modules // Importing modules
const { app, BrowserWindow } = require('electron') const { app, BrowserWindow, ipcMain } = require('electron')
const path = require('path') const path = require('path')
// Reusable function to instantiate windows // Reusable function to instantiate windows
@ -11,7 +11,7 @@ const createWindow = () => {
preload: path.join(__dirname, 'preload.js'), preload: path.join(__dirname, 'preload.js'),
} }
}) })
ipcMain.handle('ping', () => 'pong')
win.loadFile('index.html') win.loadFile('index.html')
} }

Loading…
Cancel
Save