How to call Cloud Foundry API from a node.js application deployed?

Juan Antonio BreƱa Moral <bren at>


I would like to know how to call cloud foundry API from a node.js application.

From local, it is very easy to call the API using a absolute address:

but when I deploy the node application to the platform, I can't connect with the API and I receive the following error:


I checked Application Security Group, but no rule is associated to the space used with the application.

Does exist a way to call the API from a application deployed?
Does exist a VCAP variable similar to: process.env.VCAP_APP_PORT to avoid this problem?

Many thanks in advance

Juan Antonio

Join to automatically receive all group messages.