1
0
CompleteNodeJS/weather-app/app.js
Jason Williams 5ffdfbbb98 Video 40
2019-09-29 12:36:49 -06:00

24 lines
508 B
JavaScript

const geocode = require('./utils/geocode')
const forecast = require('./utils/forecast')
const address = process.argv[2]
if (!address) {
console.log('Please provide an address')
} else {
geocode(address, (error, {latitude, longitude, location}) => {
if (error) {
return console.log(error)
}
forecast(latitude, longitude, (error, forecastData) => {
if (error) {
return console.log(error)
}
console.log(location)
console.log(forecastData)
})
})
}