【发布时间】:2017-08-08 06:19:54
【问题描述】:
尝试为 Firebase 部署最简单的 Cloud Function:
const functions = require('firebase-functions');
exports.helloWorld = functions.https.onRequest((request, response) => {
response.send("Hello from Firebase!");
})
我已经运行firebase init 并选择了functions。
Firebase CLI 创建了一个名为“functions”的文件夹,其中包含index.js 和package.json。索引文件包含上述函数。
然后我运行firebase deploy --only functions 并在我的终端中收到一条消息,表明该功能已部署。根据this page,我应该得到该函数的链接。
相反,我获得了一个指向我的项目控制台的链接。没有迹象表明该函数已部署在 firebase Web 控制台功能部分。
任何提示将不胜感激!
【问题讨论】:
-
您是否取消了在 index.js 中找到的示例函数的注释?如果您实际部署了该函数,则指向该函数的 https 链接将显示在指向控制台的链接下方。
-
以为我做到了..但我没有。现在可以了。谢谢! :)
标签: firebase google-cloud-functions