How to update url nodejs when xml file change in javascript? -


the code works , wanted updated when xml changes , without using timeut or interval

app.get('/prove', function (req, res) {     testxml("1");     res.end('ok \n'); });   testxml = function (num) { request({     uri:'urlxml',     method: "get" }, function (err, res2, body) {  ...... 

so question being asked here really: how make sure response sent after xml updates when xml updated in request?

one way of solving rewriting testxml function take callback function , calling res.end in that.

app.get('/prove', function (req, res) {   testxml("1", function(){     res.end('ok \n');   }); });   testxml = function (num, callback) {   request({     uri:'urlxml',     method: "get"   }, function (err, res2, body) {     ...     callback()   }) } 

Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -