Hello everyone ,I am trying to retrieve data from a REST API in the server side (*.js) and display it in my view (*.jade)I was able to get the data but was not able to send it to the view .This is how my code looks like :var reqGet = https.request(optionsget, function(res) {console.log("statusCode: ", res.statusCode);res.on('data', function(d) {console.info('GET result:\n');BugData =d ;console.log(d);});});reqGet.end();BugData (was defined before )is the variable i am trying to send to the view but for some reasons it is empty and does not contain the variable 'd'Does anyone know why or how can i solve this ?
Hello everyone ,I am trying to retrieve data from a REST API in the server side (*.js) and display it in my view (*.jade)I was able to get the data but was not able to send it to the view .This is how my code looks like :var reqGet = https.request(optionsget, function(res) {console.log("statusCode: ", res.statusCode);res.on('data', function(d) {console.info('GET result:\n');BugData =d ;console.log(d);});});reqGet.end();BugData (was defined before )is the variable i am trying to send to the view but for some reasons it is empty and does not contain the variable 'd'Does anyone know why or how can i solve this ?
Thanks