Let's say I'm running my server on the url test.us-west-1.elasticbeanstalk.com
. How can I get this URL from Node.js? Or the Elastic IP
?
server.listen(port, error => {
if(error){
return console.error(error);
}
var CURRENT_DOMAIN = server.listen.url; // <--- should return 'test.us-west-1.elasticbeanstalk.com' or the Elastic IP
console.log(`Server running on port: ${port} -- ${CURRENT_DOMAIN}`);
});