Hey guys i'm trying to connect to my server via a module within electron and return the error/success to be displayed in the renderer. however i'm having some trouble achieving that
preload.ts
connect: () => ipcRenderer.invoke('connect')
})```
main.ts
``` ipcMain.handle('connect', () => neo_connect())```
connect.ts
```export const neo_connect = async (): Promise<unknown> => {
try {
driver = await neo4j.driver(URI, neo4j.auth.basic(USER, PASSWORD))
const serverInfo = await driver.getServerInfo()
console.log(serverInfo)
} catch (err) {
// console.log(`${err.message}`)
return 'test'
}
}```
renderer.svelte
``` const connect = async (): Promise<void> => {
const response = await window.neo.connect()
console.log(response)
}
connect()```