云功能本地HTTP触发器

时间:2017-06-23 00:24:53

标签: javascript firebase google-cloud-functions firebase-tools

使用firebase-tools功能firebase serve时执行/触发Firebase功能locally的正确方法是什么?

让我们说你有这个功能:

exports.hello = functions.https.onRequest((req, res) => {
  res.send('Hello World');
});

如果通常会通过对hello之类的内容进行HTTP POST调用来触发生产函数https://us-central1-foobar.cloudfunctions.net/hello,如下所示:

curl -X POST -H "Content-Type:application/json" https://us-central1-foobar.cloudfunctions.net/hello

在本地使用firebase serve时,如何构建HTTP POST URL?目标是在firebase托管+功能解决方案中启动生产之前调试/测试该功能。

是否会定位localhost:5000而不是https://us-central1-foobar

感谢您提供任何帮助。

0 个答案:

没有答案
相关问题