-1
app.get( '/ ax')内のリクエストモジュールを正しく使用する方法。私は他の質問で唯一の要求モジュールの使用方法を見つけるが、どのように関数にNodeJsルート内でリクエストモジュールを使用する方法
var request = require("request")
var url = "https://www.lonelyplanet.com/usa/san-francisco/attractions/de-young-museum/a/poi-sig/1340028/1329646";
module.exports = app => {
app.get('/axe', (req, res, next) => {
req.request({
url: url,
json: true
}, function (error, response, body) {
if (!error && response.statusCode === 200) {
console.log(body) // Print the json response
}
})
});
}