【发布时间】:2018-11-25 19:52:11
【问题描述】:
我似乎无法在 Firebase Documentation 中找到解决方案。
我想在本地测试我的functions.https.onCall 函数。是否可以使用 shell 或以某种方式将我的客户端(启用 firebase SDK)连接到本地服务器?
我想避免每次只为了测试对我的onCall 函数的更改而进行部署。
我的代码
功能:
exports.myFunction = functions.https.onCall((data, context) => {
// Do something
});
客户:
const message = { message: 'Hello.' };
firebase.functions().httpsCallable('myFunction')(message)
.then(result => {
// Do something //
})
.catch(error => {
// Error handler //
});
【问题讨论】:
标签: firebase google-cloud-functions