Firebase多编程语言支持 [英] Firebase Multi Programming Language Suppport

查看:64
本文介绍了Firebase多编程语言支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个快速的问题,云功能中是否可以为Firebase Server提供多种编程语言?

I have a quick question, is it possible to have multiple programming languages for the Firebase Server in Cloud Functions?

推荐答案

每个函数必须选择一个运行时来执行.您可以提供在该运​​行时上运行的任何代码.该代码可以源自多种语言.例如,如果您以nodejs运行时为目标,则可以提供来自JavaScript,TypeScript甚至Kotlin的组合的JavaScript代码,所有这些均已转换为JavaScript.运行时无关紧要-它只执行JavaScript.

Each function must choose a single runtime for execution. You can provide any code that runs on that runtime. That code can originate from any number of languages. For example, if you target a nodejs runtime, you could provide JavaScript code that comes from a combination of JavaScript, TypeScript, and even Kotlin, all transpiled to JavaScript. The runtime doesn't care - it's going to just execute the JavaScript.

您不能合并不兼容的语言.例如,除非您以某种方式找到将Swift转换为JavaScript的方法,否则您无法将Swift和JavaScript结合使用.

You can't combine incompatible languages. For example, you can't combine Swift and JavaScript, unless you somehow find a way to transpile the Swift to JavaScript.

每个函数可以具有不同的运行时.不需要所有功能都针对相同的运行时.但是,如果您使用Firebase CLI进行部署,则只能以nodejs运行时为目标.如果需要其他运行时,则必须使用Google Cloud Platform工具(gcloud)来部署该功能.

Each function can have a different runtime. There is no requirement that all of your functions target the same runtime. However, if you're using the Firebase CLI for deployment, you can only target a nodejs runtime. If you want other runtimes, you'll have to use Google Cloud Platform tools (gcloud) to deploy the function.

这篇关于Firebase多编程语言支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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