Firebase Multi Programming Language Suppport

前端 未结 2 840
一个人的身影
一个人的身影 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.

    0 讨论(0)
  • 2021-01-28 11:05

    Google Cloud Functions supports Node, Python, Go and Javathese days. For a full list, see the documentation on the Cloud Functions Execution Environment. Many other languages can be used, as they can be transpiled to one of the above.

    When deploying your Cloud Functions through Firebase, the only supported languages is JavaScript and TypeScript on Node.js though.

    0 讨论(0)
提交回复
热议问题