Reputation: 117
In my node-red app in Bluemix, I added a User-Defined environment variable. Not sure how to get that variable from a function in my node-red application. Thanks.
Upvotes: 1
Views: 1788
Reputation: 1
To get User Defined Variable from Bluemix you must use something like this:
var services = context.global.process.env['USR_DEFINED_VAR'];
after configuring functionGlobalContext: { process: process }
in bluemix-settings.js
To change the value is just like that:
context.global.process.env['USR_DEFINED_VAR'] = value;
Upvotes: 0
Reputation: 91
You will need to edit the bluemix-settings.js file to include the "process" built-n or other variables in functionGlobalContext.
functionGlobalContext: { process: process }
Once redeployed you can access the process in a function node as...
context.global.process
Upvotes: 1