Video 38
This commit is contained in:
parent
1d6ada3e91
commit
38e23cf767
@ -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)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user