I'm developing a node.js application to get an ip address from a variable located in the cloud. Later I want to use it to establish a TCP/IP connection with a server. This is the code I'm using:
...
var settingsip;
photon.get("ipAddress", function(response) {
settingsip = response.result;
console.log("Photon IP is:", settingsip);
});
console.log("Photon IP2 is:", settingsip);
...
But the output which I'm obtaining is:
Photon IP2 is: undefined
Photon IP is: 10.230.89.118
Which is the problem for not getting the right value of settingsip when printing it as IP2?