i want to know how i can get a json response from my node.js server and display the response on my web page
`
var request = require("request"),
username = req.body.username,
password = req.body.password,
url = "https://api.ecoachsolutions.com/main.php?ecoachsignin=1&server=remote&user="+username+"&pass="+password;
console.log("url is "+url);
request.get(
{
url : url
},
function (error, response, body) {
// Do more stuff with 'body' here
if (!error && response.statusCode == 200) {
var json_body = JSON.parse(body);
console.log(json_body);
var msg = json_body.profile.user;//this is the message i want to show on my web page(msg)
console.log(msg); // get json response
}
}
);`