Files
2025-10-30 09:08:49 +08:00

25 lines
496 B
JavaScript

const { app, BrowserWindow, ipcMain } = require("electron");
const path = require("node:path");
const createWindow = () => {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, "preload.js"),
},
});
win.loadFile("index.html");
};
app.whenReady().then(() => {
ipcMain.handle("ping", () => "pong");
createWindow();
});
app.on("window-all-closed", () => {
if (process.platform !== "darwin") app.quit();
});