Reputation: 65
I’m making an action for Google home speaker with Dialogflow and Firebase (free plan). I want to send a get https request to my server to retrieve information but it fails. I use this node.js code to call rest service:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
const https = require('https');
https.get('https://myservicelink”, (res) => {
res.on('data', (d) => {
conv.ask(d);
});
}).on('error', (e) => {
conv.ask(e);
});
This code works fine outside firebase but doesn’t work when I deploy it with firebase. No errors in the Simulator logs (Actions on Google). It seems that it doesn’t enter into https.get. What’s wrong? Do I need a different firebase plan?
Upvotes: 1
Views: 228
Reputation: 50731
Yes, you need to update to a paid plan.
I suggest the Blaze Plan. Although this does require you to have a credit card on file, there is a free tier, under which you won't be billed. This free tier is more than sufficient for your initial development and testing, along with some light usage when you go into production. (You can update to the Flame plan if you wish, but it doesn't tend to be as useful in development, and still requires a credit card on file.)
Once you have released your Action, you are eligible to be part of the Community Program, which will get you $200/month in cloud credits, which you can apply to your Firebase bill.
(You can, of course, use any web service you wish without having to pay for Firebase, as long as you can provide a public HTTPS endpoint with a SSL certificate that is not self-signed.)
Upvotes: 1
Reputation: 284
The Free (Spark) plan does not allow outbound networking to anything that is not a Google service. For your code to work, you must upgrade to either the Flame or Blaze plans.
You can find the full pricing information here.
Upvotes: 1