Intento de meter las llamadas rest, creado el evento del IPC, no se

puede desde el renderer
This commit is contained in:
2026-03-11 17:29:01 +01:00
parent 869933c858
commit 4b0d4677e6
12 changed files with 136 additions and 41 deletions

View File

@@ -4,7 +4,6 @@ import { electronApp, optimizer, is } from "@electron-toolkit/utils";
import icon from "../../resources/icon.png?asset";
import { NfcService } from "../services/NfcService";
function createWindow(): void {
// Create the browser window.
const mainWindow = new BrowserWindow({
@@ -60,6 +59,12 @@ app.whenReady().then(() => {
// IPC test
ipcMain.on("ping", () => console.log("pong"));
// HANDLE es bidireccionar ON es unidireccional
ipcMain.handle("nfc:labelReq", async (_event, data: unknown) => {
console.log("nfc:labelReq", data);
return data;
});
ipcMain.handle("ping:url", async (_event, url: string) => {
try {
const response = await fetch(url, {