相关疑难解决方法(0)

如何在本地测试`functions.https.onCall` firebase云功能?

我在Firebase文档中找不到解决方案.

我想在functions.https.onCall本地测试我的功能.是否可以使用shell或以某种方式将我的客户端(启用firebase SDK)连接到本地服务器?

我想避免每次只是为了测试对我的onCall功能的更改而进行部署.


我的代码

功能:

exports.myFunction = functions.https.onCall((data, context) => {
  // Do something
});
Run Code Online (Sandbox Code Playgroud)

客户:

const message = { message: 'Hello.' };

firebase.functions().httpsCallable('myFunction')(message)
  .then(result => {
    // Do something //
  })
  .catch(error => {
    // Error handler //
  });
Run Code Online (Sandbox Code Playgroud)

firebase google-cloud-functions

11
推荐指数
4
解决办法
6014
查看次数

标签 统计

firebase ×1

google-cloud-functions ×1