Firebase:如何向云功能添加虚荣URL?

Rea*_*eal 2 javascript firebase google-cloud-platform google-cloud-functions

这里简要提到,但是现在我已经将我的GCP项目连接到Firebase,在Firebase托管下设置了一个自定义域,但是在Firebase仪表板的功能页面上,似乎没有是一种在云功能上设置虚荣URL的方法.

我的firebase.json(在我的项目的根目录)看起来像:

{
    "hosting": {
        "public": "public",
        "rewrites": [
            { "source": "/helloWorld", "function": "helloWorld" },
            { "source": "/progress", "function": "progress" }
        ]
    }
}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

Fra*_*len 7

要将虚荣域与您的云功能相关联,您需要将它们与Firebase托管相关联.请参阅有关连接两者文档.

假设您有云功能https://us-central1-<your-project-id>.cloudfunctions.net/bigben.

进行此连接后,该功能也将可用https://<your-project-id>.firebaseapp.com/bigben.

如果您还使用Firebase托管连接自定义域,则该功能也可用https://<your-custom-domain>.com/bigben.