从Node.js调用Firebase Cloud函数 [英] Calling a firebase cloud function from nodejs

查看:48
本文介绍了从Node.js调用Firebase Cloud函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从另一个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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆