Files
WaifuBoard/main.js
2025-12-04 21:27:35 +01:00

36 lines
680 B
JavaScript

const { app, BrowserWindow } = require('electron');
const { fork } = require('child_process');
const path = require('path');
let win;
let backend;
function startBackend() {
backend = fork(path.join(__dirname, 'server.js'));
}
function createWindow() {
win = new BrowserWindow({
width: 1200,
height: 800,
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
}
});
win.setMenu(null);
win.loadURL('http://localhost:3000');
}
app.whenReady().then(() => {
startBackend();
createWindow();
});
app.on('window-all-closed', () => {
if (backend) backend.kill();
app.quit();
});