1
0
This commit is contained in:
Jason Williams 2019-08-25 15:31:41 -06:00
parent 1d6ada3e91
commit 38e23cf767

View File

@ -1,12 +1,23 @@
const geocode = require('./utils/geocode')
const forecast = require('./utils/forecast')
geocode('Boston', (error, data) => {
console.log('Error', error)
console.log('Data', data)
})
const address = process.argv[2]
forecast(-75.7088, 44.1545, (error, data) => {
console.log('Error', error)
console.log('Data', data)
})
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)
})
})
}