Firebase Multi Programming Language Suppport

前端 未结 2 844
一个人的身影
一个人的身影 2021-01-28 10:08

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

2条回答
  •  滥情空心
    2021-01-28 10:55

    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.

    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.

    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.

提交回复
热议问题