Example For Electron w/ SSR and API Page Routes Support #28243
Replies: 2 comments 8 replies
-
It is possible using a custom server: You can follow these steps to create one:
I have created both Express and NextJS versions to prove it is possible: |
Beta Was this translation helpful? Give feedback.
-
NVM, I was able to make it work with app router, check here - https://github.com/spa5k/nextjs_approuter_electron |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature you'd like to request
Hey Next.js team!
Amazing framework. Really happy with the developer experience overall.
Looking to see if it would be possible to get an example put together on how to use Electron.js with SSR/API Page Route Support.
The first question in that is, can it be done? After some research there does not seem to be any examples of such.
I see that there is an example for Electron.js/TypeScript here: https://github.com/vercel/next.js/tree/master/examples/with-electron-typescript and the Nextron repo here: https://github.com/saltyshiomix/nextron
But those don't appear to cover the server-side features that Next.js provides. Am I wrong in that assessment?
If this kind of support does not currently exist, a suggestion towards that solution could be that instead of hosting the API Routes/Server level in the Electron app, you instead provide a way to connect it your running Web app version of the Next app server. That way it can remain more static and utilize the already running web-server.
Are there any other alternatives out there than Electron that may cover this use-case?
Thank you for your time!
Cheers
Describe the solution you'd like
Example repo of a working Electron.js integration with Next.js, that supports SSR and API Page route support (so our server routes are available for requests).
As mentioned above, a solution, if not already supported, could be to make the running web-app's server available by the Electron app.
Describe alternatives you've considered
No other alternatives seem practical. A low-budget solution would probably just be an native app that redirects to the web-app. Resources aren't available to build out something more comprehensive if Electron integration isn't possible.
Beta Was this translation helpful? Give feedback.
All reactions