package server with client

This commit is contained in:
Bruce MacDonald
2023-06-23 18:38:22 -04:00
parent f0eee3faa0
commit c5bafaff54
8 changed files with 183 additions and 5 deletions

View File

@@ -1,4 +1,6 @@
import { app, BrowserWindow } from 'electron'
import { spawn } from 'child_process'
import * as path from 'path'
// This allows TypeScript to pick up the magic constants that's auto-generated by Forge's Webpack
// plugin that tells the Electron app where to look for the Webpack-bundled app code (depending on
// whether you're running in development or production).
@@ -24,6 +26,17 @@ const createWindow = (): void => {
transparent: true,
})
// Start the executable
let pyExecutable = path.join(__dirname, '../renderer/resources/server')
console.log(`Starting ${pyExecutable}`)
let pyProcess = spawn(pyExecutable)
pyProcess.stdout.on('data', data => {
console.log(`server: ${data}`)
})
pyProcess.stderr.on('data', data => {
console.error(`server: ${data}`)
})
// and load the index.html of the app.
mainWindow.loadURL(MAIN_WINDOW_WEBPACK_ENTRY)