IPC routing completed.

This commit is contained in:
2024-05-28 03:28:51 +10:00
parent 32d64524e3
commit 17e7bb137e
5 changed files with 45 additions and 17 deletions

View File

@@ -2,6 +2,20 @@ import { app, shell, BrowserWindow, ipcMain } from 'electron'
import { join } from 'path'
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
import icon from '../../resources/icon.png?asset'
import fs from 'node:fs/promises'
async function loadConfigurationYAML() {
try {
const data = await fs.readFile('./resources//config.yaml', { encoding: 'utf8' });
console.log(data);
return data
} catch (err) {
console.log(err);
return (`There was an error reading the file: <br> ${err} `)
}
}
function createWindow() {
// Create the browser window.
@@ -51,6 +65,7 @@ app.whenReady().then(() => {
// IPC test
ipcMain.on('ping', () => console.log('pong'))
ipcMain.handle("loadConfigurationYML", loadConfigurationYAML)
createWindow()