【发布时间】:2017-08-08 20:30:19
【问题描述】:
Cloud Functions 和 Firebase Functions (or "Cloud Functions for Firebase") 看起来都一样。请描述每个的用例。
两者都使用 HTTP 函数。
在云函数中:
exports.helloHttp = function helloHttp (req, res) {
res.send(`Hello ${req.body.name || 'World'}!`);
};
在 Firebase 函数中:
exports.helloWorld = functions.https.onRequest((request, response) => {
response.send("Hello from Firebase!");
});
这些有什么区别?
【问题讨论】:
-
Firebase 的术语实际上是 Cloud Functions for Firebase,它几乎就是与 Firebase 服务集成的 Cloud Functions。
-
那么两者没有区别?
-
想补充一点,不能完全回答你的问题。您可以使用 Google Cloud Functions 以不同的语言(NodeJS、Python。听说 Go 即将推出)进行编码。
标签: firebase google-cloud-platform google-cloud-functions