Electron build



  • Hi,
    I developed a small Quasar app with SSR following instructions and using /src-ssr/extension.js (Sequelize & SQLite) as Backend, everything runs properly on the browser, when I compile for Electron it doesn’t reach Node/Express route
    a068555a-b9ef-4ae4-9304-2236e6ff179d-image.png
    I already add app.use(ssr.resolveUrl(’/api/empleados’) on the routes but it seems something with the port, I also changed to another one but no luck… Am I missing something? would you please guys help me?
    Thanks



  • @operez2000 The express server under src-ssr does not run with Electron. You would have to re-create the express api under src-electron. You could share code between the two and require the shared code in both src-ssr and src-electron. But it’s not always the best idea to run a server locally this way, depending on your security model since the endpoint is completely exposed to any process running on that user’s computer. Also, the user might be running something else on that port (which can be solved by using a randomized port on start.)

    But better yet is to use electron’s ipc to communicate from the frontend to the backend. It would require some more work to make the frontend either call ipcRenderer or axios depending on the mode. You still could share code between ssr and electron, but it involves more work.


Log in to reply