How to stop embedded Node-RED?

Hello everyone,
I am developing software to help program microcontroller boards and I want to integrate Node-RED into my Electron application to retrieve data sent by my boards.
I used the example code ( and it works fine, but I can't find how to stop the Node-Red runtime (the RED.stop() command doesn't stop anything) or even the express server. I have the impression that it's the same solution everywhere: close the application window. But this is not a solution in my opinion...
I would like the user to be able to launch a popup (node-red launches in the background) and close it (and thus close node-red and the express server). This seems impossible...
I tried to list the connections to close them one by one but it doesn't work, I tried to replace Express with Fastify but the problem is the same. In short....HELLLLPPP !!!!
Thank you very much in advance.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.