I have been using following code on my app on local :let options = {uri : 'http://localhost:3000/save',method : 'GET'};util.log("Saving with options ::",options);request(options, function (err, res) {let response = res ? (res.body) : {};if (err || response.error) {util.log('SAVE FAILED :: ',(err || response.error));}util.log("Message from save ::", response.message);});This worked perfectly on localhost. Now I have deployed my app on a server (openode) and when same function is called there I am getting this error :Error: connect ECONNREFUSED 127.0.0.1:3000at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {errno: 'ECONNREFUSED',code: 'ECONNREFUSED',syscall: 'connect',address: '127.0.0.1',port: 3000Now if I am not wrong my app is listening on port 3000 then why this is failing? How can I avoid this?
Submitted August 18, 2020 at 04:20PM by GhostFoxGod
No comments:
Post a Comment