运行 electron 中前端和后端同时存在

Running front- and backend at the same time in electron

我正在尝试 运行 我的 express 后端与我的 reactjs 前端同时运行。 前端和后端需要打包到一个电子应用程序中。由于我是反应和电子的初学者,所以答案可能是显而易见的。

那么问题来了: 有哪些可能的方法可以实现所描述的行为?

我找到了一个方法。肯定有一个更优雅的,但是 spawning a child process for the backend in the main process of electron 确实工作得很好。