Firebase:如何向云功能添加虚荣URL? [英] Firebase: How do you add a vanity URL to a cloud function?

查看:143
本文介绍了Firebase:如何向云功能添加虚荣URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简要提到

解决方案

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



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



完成此连接后,此功能也可在 https://< your-project-id> .firebaseapp.com / bigben



如果您还将自定义域与Firebase托管相关联,此功能也可在 https://< your-custom-domain> .com / bigben 上使用。


Was briefly mentioned here, but right now I'm at the point where I've connected my GCP project to Firebase, set up a custom domain under Firebase hosting, but on the functions page of the Firebase dashboard, there doesn't seem to be a way to set the vanity URL on a cloud function.

My firebase.json (at the root of my project) looks like :

{
    "hosting": {
        "public": "public",
        "rewrites": [
            { "source": "/helloWorld", "function": "helloWorld" },
            { "source": "/progress", "function": "progress" }
        ]
    }
}

解决方案

To associate a vanity domain with your Cloud Functions, you need to associate them with Firebase Hosting. See the documentation on connecting the two.

Say you have a Cloud Function https://us-central1-<your-project-id>.cloudfunctions.net/bigben.

After making this connection the function will also be available on https://<your-project-id>.firebaseapp.com/bigben.

If you also connect a custom domain with Firebase Hosting, the function will also be available on https://<your-custom-domain>.com/bigben.

这篇关于Firebase:如何向云功能添加虚荣URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆