返回值为null
api具体怎么写的呢
api具体怎么写的呢
2019-08-31
豆瓣API有变化,需要在请求API的url后面跟一个apikey参数:
电影列表API:http://api.douban.com/v2/movie/in_theaters?apikey=0df993c66c0c636e29ecbb5344252a4a&start=0&count=10
电影详情API:`http://api.douban.com/v2/movie/subject/${event.movieid}?apikey=0df993c66c0c636e29ecbb5344252a4a`
参考了别人给的豆瓣API exports.main = async (event, context) => {console.log(`start is ${event.start}, count is ${event.count}`)var url = `http://api.douban.com/v2/movie/in_theaters?apikey=0df993c66c0c636e29ecbb5344252a4a&start=${event.start}&count=${event.count}`console.log(url)return rp(url).then(function (res) {return res}).catch(function (err) {console.err(err)});}
举报