I am trying to use an environment variable to not set the "http address", because the IP address may change while use to AWS machine. How can I use an environment variable where it find the HTTPAddresses? Here I use the localhost address but at AWS I can not use like so. Any suggestion how to solve this problem?
var envv = (process.env.NSQD_RETH || "localhost:4161").split(",");
var connection = null;
r.connect( {host: 'localhost', port: 28015, db:'test', authKey:''}, function(err, conn) {
if (err) throw err;
connection = conn;
var eventreader;
eventreader = new nsq.Reader('ev_topic', 'ev_channel', {
lookupdHTTPAddresses: envv
});
Thanks in advance.