I need to get some data from openweather-api for my firebase project, I used the npm package and node.js to do this in firebase-cloud functions. The code I used,
var weather = require('openweather-apis');
weather.setAPPID('2a1ad423e9fad1a3ceda81fda56b1366');
weather.setLang('en');
weather.setUnits('metric');
weather.setCity('seoul');
// weather.setCoordinate(41.9152,12.5068)
weather.getSmartJSON(function(err,smart){
console.log(smart);
});
error appearing in firebase functions log is,
Error: getaddrinfo ENOTFOUND api.openweathermap.org
api.openweathermap.org:80
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
via Maleesha Wijeratna
No comments:
Post a Comment