简体   繁体   中英

How do I share a node-red app developed in Bluemix?

I'm new to bluemix / node-red. I have developed a trial app and got it working. Now I'd like to share it with some others for review / modification in their bluemix environments. Is there an direct way to package up the entire node-red application, including the flows (there is a fair bit of html/javascript) and some images ? I used git to get the images into the node-red file structure but it does not seem to sync the actual flows. I realize that the flows are normally stored in Cloudant for runtime reasons but it seems that there ought to be an orderly transfer method (besides cut/paste) especially for moving from (say) dev-->test-->prod.

You can export your node-red flow as a json file and share it. Others can import this json file and they will be able to see your flow.

To export your node-red flow:

1) In the UI select all nodes you want to export (selected nodes will have a red border)

2) Click on the top-right menu (three parallel lines just after the deploy button) and select Export->Clipboard

3) Copy the json file from the "Export nodes to clipboard" window and save a file

To import the json file, follow similar steps but select Import->Clipboard and paste the json file content to import the nodes.

This is because the flows can't be stored in the deployed application file system image because it would get thrown away with every time the app is restaged (either due to a update or getting moved between hosting servers by the underlying Cloud Foundry/Bluemix system)

If you export the flow you want to share with your colleges and check it into your git repo in to defaults/flow.json when they clone the repo and deploy it will start with your flow in place. Any updates they make will be saved to the bound Cloudant instance so it will survive app updates.

This is mentioned in the README.md from the node-red-bluemix-starter project.

EDIT: The Node-RED flow storage system is also plugable , so you could always implement your own git based flow storage engine if you wanted.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM