36 lines
942 B
JavaScript
36 lines
942 B
JavaScript
/* =========================================================
|
||
FOOTBALL STATS API - MAIN PROCESS (ELECTRON)
|
||
---------------------------------------------------------
|
||
Ce fichier lance l'application desktop Electron.
|
||
========================================================= */
|
||
|
||
const { app, BrowserWindow } = require("electron");
|
||
const path = require("path");
|
||
|
||
|
||
/* =========================
|
||
CRÉATION DE LA FENÊTRE
|
||
========================= */
|
||
|
||
function createWindow () {
|
||
|
||
const win = new BrowserWindow({
|
||
width: 1200,
|
||
height: 800,
|
||
|
||
webPreferences: {
|
||
nodeIntegration: true, // permet d’utiliser require dans le front
|
||
contextIsolation: false // simplifie le développement
|
||
}
|
||
});
|
||
|
||
// Chargement de l'interface principale
|
||
win.loadFile(path.join(__dirname, "index.html"));
|
||
}
|
||
|
||
|
||
/* =========================
|
||
LANCEMENT APPLICATION
|
||
========================= */
|
||
|
||
app.whenReady().then(createWindow); |