【问题标题】:firebase Function - how to define region locationfirebase 函数 - 如何定义区域位置
【发布时间】:2021-06-26 02:52:52
【问题描述】:

当我第一次为 Firebase Function 进行 firebase 部署时,我注意到了 它似乎默认为

✔  functions[helloWorld(us-central1)]: Successful create operation. 

我应该在哪里定义函数的区域?

这是从 firebase 函数生成的代码 - firebase init https://gist.github.com/axilaris/9a9edee075860683153155e6277f2a08

【问题讨论】:

    标签: node.js firebase npm google-cloud-functions


    【解决方案1】:

    您需要像这样指定区域:

    exports.helloWorld = functions.region("europe-west2").https.onRequest((request, response) => {
      functions.logger.info("Hello logs!", {structuredData: true});
      response.send("Hello from Firebase!");
    });
    

    您可以阅读更多相关信息并在documentation 中查看可用区域列表。

    【讨论】:

      猜你喜欢
      • 2023-01-29
      • 2020-10-03
      • 2019-10-09
      • 2020-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-10
      相关资源
      最近更新 更多