implemented electron

This commit is contained in:
2025-12-04 21:27:35 +01:00
parent d46d642639
commit db74808e6c
13 changed files with 809 additions and 39 deletions

35
main.js Normal file
View File

@@ -0,0 +1,35 @@
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();
});