0
我正在使用Node-RED并希望在Bluemix VCAP_SERVICES
中进行解析,但是出现错误。我的代码是:为什么Node-RED无法解析Bluemix中的VCAP_SERVICES环境?
var services = context.global.VCAP_SERVICES;
var env_cloudint = services['CloudIntegration'][0].credentials;
,但我得到这个错误:
TypeError: Cannot read property 'CloudIntegration' of undefined
我有CloudIntegration我VCAP_SERVICES
。在我的代码中是否需要额外的东西来利用VCAP_SERVICES
?
你的错误表明'服务'本身是未定义的,并不是'services'数组中的'CloudIntegration'是未定义的 –