Single Node-RED instance has two roles, both development environment(Editor) and flow execution environment(Runtime). Therefore developer and application users should access to single Node-RED instance. This architecture will be useful for PoC because developer easily modify the flow when users found bug or improvement idea. But it is rare architecture in terms of Cloud Foundry application.
In general, developer creates their code on local PC. After the coding, he/she deploy it into Cloud Foundry using cf push command. The following diagram shows an example of PHP application development.
Node-RED buildpack realizes common style of application development. After developer creates flow on local Node-RED environment, they can deploy it into Cloud Foundry. In detail, cf push command send only flow file. After that, Cloud Foundry builds Node-RED instance from the flow file using Node-RED buildpack. Node-RED buildpack will be useful for Blue-green deployment and scaling instances.
cf login -a <Cloud_Foundry_endpoint>
cf push <application_name> -p <node-red_directory> -b https://github.com/zuhito/node-red-buildpack.git
node-red
C:\Users\<user_name>\.node-red\flows_<host_name>.json
cf login -a api.ng.bluemix.net
cd C:\Users\<user_name>\
cf push <application_name> -p .node-red -b https://github.com/zuhito/node-red-buildpack.git