使用Python的Firebase云功能? [英] Firebase cloud functions using Python?

本文介绍了使用Python的Firebase云功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在将GCP的Firebase与Firestore一起用于我们正在开发的新移动应用程序.作为这项工作的一部分,我们需要部署许多云功能,这些功能将作为Firestore触发器来执行一些后端处理.

We are using GCP's Firebase with Firestore for a new mobile app we are developing. As part of this effort we need to deploy a number of cloud functions which will act as Firestore triggers for doing some back end processing.

我们的目的是通过使用firebase cli工具将部署封装在Firebase中.但是,当我们尝试使用"firebase初始化函数"来启动功能的Firebase项目时,只有两个语言选项是"Javascript"和"Typescript",并且唯一可部署的堆栈似乎是Node.js.

Our intention is to keep the deploys encapsulated inside of Firebase by using the firebase cli tools. However when we attempt to initiate the Firebase project for functions using the "firebase init functions" call the only two language options are "Javascript" and "Typescript", and the only deployable stack seems to be Node.js.

在以前的GCP项目中,我们已经部署了基于Python的云功能(使用gcloud cli),理想情况下,我们希望继续将Python用于Firebase云功能.所以我的问题是:

On previous GCP projects we had deployed Python based cloud functions (using the gcloud cli) and ideally we'd like to continue using Python for our Firebase cloud functions. So my questions are:

  1. 是否可以部署基于Python的Firebase云功能?如果没有:

  1. is it possible to deploy Python-based Firebase cloud functions? If not:

我们可以简单地回到使用gcloud cli部署基于Python的GCP云功能,并且仍然让它们作为Firestore触发器工作吗?

can we simply go back to deploying Python-based GCP cloud functions using the gcloud cli and still have them work as Firestore triggers?

谢谢

推荐答案

Firebase CLI不支持部署以python编写的功能.

The Firebase CLI does not support deploying functions written in python.

您当然可以在python中编写Cloud Firestore触发器并部署它们使用gcloud.

You can certainly write Cloud Firestore triggers in python and deploy them with gcloud.

您可能不知道的一件事:无论如何部署功能,底层的Cloud Functions产品都是相同的. Firebase只是在现有的Google Cloud Functions基础架构之上添加了工具和API.确实没有"Firebase Cloud Function"这样的东西.只有云功能,您可以选择使用gcloud或Firebase CLI编写和部署它们的方式.

One thing you might not be aware of: the underlying Cloud Functions product is the same no matter how you deploy your functions. Firebase just adds tools and APIs on top of the existing Google Cloud Functions infrastructure. There is really no such thing as a "Firebase Cloud Function". There is just Cloud Functions, and you have options about how you can write and deploy them, either using gcloud, or the Firebase CLI.

这篇关于使用Python的Firebase云功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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