【问题标题】:Use Python Google Cloud Function in Firebase Hosting在 Firebase 托管中使用 Python Google Cloud 函数
【发布时间】:2020-02-10 07:01:24
【问题描述】:

我有一个名为“artificiellt_osterbotten”的 Python Google Cloud 函数(不是 Firebase 函数),我想通过 Firebase 托管来触发它。这是我的 firebase.json 文件:

{
  "hosting": {
    "public": "public",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
    "rewrites": [
      {
        "source": "/artificiellt_osterbotten",
        "function": "artificiellt_osterbotten"
      }
    ]
  }
}

该路线似乎正在运行,但我得到的只是 404。我假设这与 Firebase 和 GCP 之间的断开连接有关。但是,该功能确实显示在 Firebase 控制台中。

有人知道这里有什么问题吗?甚至可以从 Firebase 托管触发 GCP Cloud Functions 吗?

我已将 Firebase 计划升级到 Blaze。

【问题讨论】:

标签: python firebase google-cloud-platform google-cloud-functions firebase-hosting


【解决方案1】:

事实证明,我只需要让位于us-central1 的函数就可以工作。希望它可以在 CLI 中警告我,这样可以节省我几个小时!

对于未来的读者,firebase 正在处理一个 open issue,它似乎会发出警告,或者会发生多区域支持。

【讨论】:

    猜你喜欢
    • 2020-09-13
    • 2019-03-02
    • 2020-03-02
    • 2020-10-26
    • 1970-01-01
    • 1970-01-01
    • 2020-11-25
    • 2018-12-11
    • 2018-07-08
    相关资源
    最近更新 更多