0
votes

I am trying to use google contact api in firebase free plan. It gives me an error ERROR: getaddrinfo ENOTFOUND www.google.com www.google.com:443

As far as I know firebase allow us to user google services in their free plan but why I am getting this error.

var options = {
          host: 'www.google.com',
          path: '/m8/feeds/contacts/default/full?access_token=token&alt=json'
        };

https.get(options, function(res) {
//my function
});
2
Where are you trying to run this code? - Frank van Puffelen
Running it through firebase cloud functions - bankaujjwal

2 Answers

2
votes

With spark plan of firebase, there is a restriction on domains and you can't call any API other than Google.

For your case, you should replace www.google.com with www.googleapis.com to get it work

0
votes

Username in the URL should be default, not me.