Я хочу отправить res.json в ответ на запрос, используемый в API
api.app.get('/url', function(req, res) {
request({
url: "http://localhost:3001/myUrl", method: 'GET',
headers: {
'Content-Type': "application/json",
'Accept': "application/json",
}
}
, function (err, stdout, body) {
console.log(err)
console.log(body)
res.json({success:true, data:"raed"})
})
});
Это res.json({success:true, data:"raed"})
не выполняется.
но два console.log
выполнены успешно.
Есть решение, пожалуйста?