【发布时间】:2015-05-06 17:27:10
【问题描述】:
我正在使用 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
我的VCAP_SERVICES 中有 CloudIntegration。我是否需要在代码中添加任何额外内容才能利用 VCAP_SERVICES?
【问题讨论】:
-
您的错误表明“服务”本身未定义,而不是“服务”数组中的“CloudIntegration”项未定义