I was considering this since I'm making an Offline Desktop Electron app and wanted to make some reusable functions for an app that could be a new SaaS solution.
So unless you were thinking of the same, then I don't really find any good reason to have this. I'm trying to find some best practices, but I found little to none. It seems the practice was quite uncommon although totally possible. Technically, all you have to do is use the Electron as a server.
At first, I tried out ExpressJS just to make sure whether the express app could run, the only problem I had was with cors
, but things went well after that. What I can see is, that if you're planning to create a desktop app, and it was about to go complex, you should just go to your usual web library/framework tools to make it easier.
But hey, I'm open to suggestions if I made a mistake okay. I'm trying out this myself. I'll update anytime if I found the cons of it.