我正在使用云功能在免费火花层上调用另一个云功能.
是否有一种特殊的方式来调用另一个云功能?或者您只是使用标准的http请求?
我试过直接调用其他函数:
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))
})
Run Code Online (Sandbox Code Playgroud)
但是我得到了错误
FetchError:请求 https:// us-central1-functions-****.cloudfunctions.net/validate failed,reason:getaddrinfo ENOTFOUND us-central1-functions - *****.cloudfunctions.net us-central1-functions -*****cloudfunctions.net:443
哪个听起来像firebase阻止连接,尽管它是谷歌拥有的,因此它不应该被锁定
Spark计划仅允许对Google拥有的服务的出站网络请求.
如何使用云功能调用另一个云功能?
javascript node.js firebase google-cloud-platform google-cloud-functions