IPC routing completed.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user