从Node.js调用Firebase Cloud函数 [英] Calling a firebase cloud function from nodejs
问题描述
我想从另一个Node.js服务器或仅NodeJS脚本的Firebase调用云函数.
I want to call a cloud function from firebase from another nodejs server or just a nodejs script.
我的firebase函数是一个onCall函数.
My firebase function is an onCall function.
我正在使用 https://www.npmjs.com/package/firebase-admin 与Firebase进行交互,但似乎没有调用云函数的方法...
I am using https://www.npmjs.com/package/firebase-admin for interacting with firebase but it doesn't seem to have a way of calling cloud functions...
我能以其他方式做到吗?喜欢http请求吗?
Can I do it any other way? Like a http request?
推荐答案
简而言之:您必须触发http事件.
当前,firebase确实支持两个调用选项.
如果您在此处和预定的调用,但是正如我从评论中看到的那样,它不是您正在寻找什么.
In short: You have to trigger http event.
Currently, firebase does support two invoke options.
If you read through documentation here and here, there is always has to be some trigger.
And firebase accept http request.
Even if you use mobile app from example one, under the hood, firebase SDK will make http request.
The other option is scheduled invocations, but as I get from comments, it's not what you're looking for.
这篇关于从Node.js调用Firebase Cloud函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!