Any reason to use web server (Express) within Electron app? Any reason to use web server (Express) within Electron app? express express

Any reason to use web server (Express) within Electron app?


I think the scenario is pretty odd: The combination of a desktop-UI with a server-framework seems to be somewhat counter-intuitive.

What you see when file:// is referenced are (local) file system calls - these could well be calls to other protocols like http:// or ws:// instead, and do not require the Express framework to be present.

Instead, Express enables your application to receive connections from the outside and act as a server. This could be a webserver serving static or dynamic content, a REST-API endpoint or some other kind of web service endpoint.

There is indeed a project showing exactly this combination: The Express server is responsible for serving content, Electron is used to wrap a logging-UI that displays whatever is currently happening.

From an architecturial standpoint however, I would probably seperate each of these concerns into seperate standalone applications.