I use Cloud Function to call another cloud function at a free spark level.
Is there a special way to call another cloud function? Or are you just using a standard HTTP request?
I tried calling another function directly like this:
exports.purchaseTicket = functions.https.onRequest((req, res) => { fetch('https://us-central1-functions-****.cloudfunctions.net/validate') .then(response => response.json()) .then(json => res.status(201).json(json)) })
But I get an error
FetchError: request https: // us-central1-functions- ****. cloudfunctions.net/validate failed, reason: getaddrinfo ENOTFOUND us-central1-functions - ***** cloudfunctions.net. us-central1-functions -. ***** cloudfunctions.net:443
It looks like firebase is blocking the connection, even though it belongs to Google, and therefore it should not be blocked
Spark's plan only allows outgoing network requests to Google-owned services.
How can I use Cloud Function to call another Cloud function?
ro-savage
source share