I've been struggling with this for a while now -- how to easily switch between the 5 different projects I have set up. I already have a separate userdir for each project, and each one has a different set of dependencies, so as I add nodes I use --save to add them to each project's package.json file
Generally, I'd like to run the latest version of node-red and its nodes on all projects, so right now I have to npm update each project when a new version comes out. Each userdir also uses its own setting file, so if i make a change in one I generally need to make the same change in all my projects. Not a show stopper, but it gets old.
Each project has its own port number, so I can run them at the same time, if needed. If I use Nick's package template as you mentioned, would it have a separate "script" entry for each project, like this?
{
"name" : "node-red-projects",
"version" : "0.0.1",
"dependencies": {
"node-red": "^0.15",
},
"scripts": {
"project1": "node node_modules/node-red/red.js --userDir ./proj1",
"project2": "node node_modules/node-red/red.js --userDir ./proj2",
"project3": "node node_modules/node-red/red.js --userDir ./proj3"
},
}
Ideally, I would have only one port available for all my node-red projects, followed by the project name as part of the admin/ui urls:
So, I could go to localhost:1880/proj1/admin instead of localhost:18801/admin for instance...
But it seems I would have to have control of the Express server for those routes to be enabled. Julian, is that why you created the multi project template to solve that problem? In general, and assuming the same security levels for all, how do others handle bouncing between projects like this?
--
Steve