1
0
CompleteNodeJS/weather-app/app.js
Jason Williams 38e23cf767 Video 38
2019-08-25 15:31:41 -06:00

24 lines
496 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, data) => {
if (error) {
return console.log(error)
}
forecast(data.latitude, data.longitude, (error, forecastData) => {
if (error) {
return console.log(error)
}
console.log(data.location)
console.log(forecastData)
})
})
}