我无法返回值,它显示为空:
const request = require('request');
const key = require('./key/key');
getweather = (city) => {
request(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${key}`,(err, response, body)=>{
return JSON.parse(body);
})
};
module.exports = getweather;