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


Amit Kumar Gupta
 

Have you tried the same thing that worked before:
https://api.MY_PUBLIC_IP.xip.io/v2/info?

That public IP is your load balancer, HA Proxy, or router; traffic there
will know how to get routed to the CC's advertising the "
api.MY_PUBLIC_IP.xip.io" route.

The things like CF_INSTANCE_IP are the IP of the container (running your
node app), so it will definitely not work.

Best,
Amit

On Tue, Aug 11, 2015 at 12:05 PM, Juan Antonio BreƱa Moral <
bren(a)juanantonio.info> wrote:

I have tested with this combinations:

var API_URL = "http://api." + process.env.VCAP_APP_HOST + ".xip.io/v2/info
";
var API_URL = "http://api." + process.env.VCAP_APP_HOST + "/v2/info";
var API_URL = "http://api." + process.env.CF_INSTANCE_IP + "/v2/info";
var API_URL = "http://api." + process.env.CF_INSTANCE_IP + ".
xip.io/v2/info";
var API_URL = "http://api." + process.env.CF_INSTANCE_ADDR + ".
xip.io/v2/info";
var API_URL = "http://api." + process.env.CF_INSTANCE_IP + ".
xip.io/v2/info";
var API_URL = "//api." + process.env.VCAP_APP_HOST + "/v2/info";

but I failed with the idea to get this data:
http://apidocs.cloudfoundry.org/214/info/get_info.html

How to connect?

Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.