【发布时间】:2017-11-26 10:22:27
【问题描述】:
使用firebase-tools 功能firebase serve 时执行/触发Firebase 功能locally 的正确方法是什么?
假设你有这个功能:
exports.hello = functions.https.onRequest((req, res) => {
res.send('Hello World');
});
如果通常人们会通过对https://us-central1-foobar.cloudfunctions.net/hello 之类的东西进行 HTTP POST 调用来触发生产功能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?
感谢您提供的任何帮助。
【问题讨论】:
标签: javascript firebase google-cloud-functions firebase-tools