问题描述
response.send
不起作用。我认为回调有问题吗?
console.log
什么也不打印。
请帮助!
const teamToIDs = {
"lakers": "1610612747","warriors": "1610612744","heat": "1610612748","suns": "1610612756"
}
app.get('/teams/:teamName',function(request,response){
urllib.request('http://data.nba.net/10s/prod/v1/2018/players.json',function (err,data) {
let teamName = request.params.teamName
const result = JSON.parse(data.toString())
teamToIDs = result.league.standard
console.log(data[teamName])
})
response.send(teamToIDs[teamName])
})
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)