No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Electron build

    Framework
    2
    2
    158
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      operez2000 last edited by

      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

      beets 1 Reply Last reply Reply Quote 0
      • beets
        beets @operez2000 last edited by

        @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.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post