Closed mkaste closed 6 years ago
The code is expecting the vcap
option to have a services
property:
vcap
- provide values for theVCAP_APPLICATION
andVCAP_SERVICES
environment variable, when running locally. The object can have propertiesapplication
and/orservices
, whose values are the same as the values serialized in the respective environment variables.
In your example, change
var appEnv = cfenv.getAppEnv({
vcap: vcapLocal
})
to
var appEnv = cfenv.getAppEnv({
vcap: { services: vcapLocal }
})
and I think it will work.
Here's a complete example: https://runkit.com/pmuellr/cfenv-issue-29
Yes, that solved it. I missed the "object can have properties .. and/or services". Thanks a lot for a quick reply.
Hi!
I am having issues with cfenv and a local vcap file. I created a user defined service with credentials in bluemix. I then exported that vcap definition from BM to use in my development environment.
I followed the instructions to configure cfenv with the local vcap:
But when I try to fetch the credentials of the user-provided service, I always get an empty object.
var myserviceCreds = appEnv.getServiceCreds(/myservice/) || {};
Now I am not sure if cfenv considers user-provided sections or only "services"? Is my vcap file wrong?
Thanks in advance for any feedback.