I have been working on node-red projects for past 7 months and now trying to make a node js based web app with node-red at its backend embedded within the project.
Steps I fallowed while making this application.
- Made a node.js project folder with npm init -y.
- Installed node red locally within the project folder.
- installed express npm package.
- Fallowed the
[Embedding into an existing app](https://nodered.org/docs/user-guide/runtime/embedding)
instruction. - Tested the developed architecture by accessing the node-red running in the server hosted by means of node js.
- The node red editor was available at 'localhost:8000/red' url.
- When i try to use node js pkg module to make an standalone node red application i faced some errors which i solved by specifically mentioning the assets and scripts required for the package.
8.When i use the command pkg . in project directory terminal, i get the application.exe file for the developed nodejs project.
9.When i run this app i am able to access the node red terminal after launching the exe.
10. The issue i am facing is with respect to the control of the userDir property of the nodered.
11. Inorder to embed the node red within the node js app the settings were explicitly mentioned. and they were used when setting up the express app server.
12. Here the application is creating an extra folder with the nodered which needs to be avoided.
13. The project structure in above image already has a nodered folder which is supposed to be used as the user dir but the packaged application ends up creating a new node red folder.
14.
15. I have come across the posts with the problem solution of electron js but i would like to try this way and so i am looking out for valuable responses. kindly look into this case and aid me in this as this can help a lot. also i am not sure if any other solution exits do mention it as well.
Thank you all