mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
27 lines
646 B
JavaScript
27 lines
646 B
JavaScript
const { app, BrowserWindow } = require("electron");
|
||
const path = require("path");
|
||
|
||
function createWindow() {
|
||
const win = new BrowserWindow({
|
||
width: 1000,
|
||
height: 700,
|
||
webPreferences: {
|
||
nodeIntegration: false,
|
||
contextIsolation: true,
|
||
},
|
||
});
|
||
|
||
// Charge ton frontend côté serveur Express
|
||
win.loadURL("http://localhost:8080"); // Express tournera comme d’habitude
|
||
}
|
||
|
||
app.whenReady().then(() => {
|
||
// lancer Express avant d’ouvrir Electron
|
||
const expressServer = require("./server/server.js");
|
||
createWindow();
|
||
});
|
||
|
||
app.on("window-all-closed", () => {
|
||
if (process.platform !== "darwin") app.quit();
|
||
});
|