简体   繁体   English

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

[英]Firebase: How do you add a vanity URL to a cloud function?

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

My firebase.json (at the root of my project) looks like : 我的firebase.json(在我的项目的根目录)看起来像:

{
    "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. 要将虚荣域与您的云功能相关联,您需要将它们与Firebase托管相关联。 See the documentation on connecting the two . 请参阅有关连接两者文档

Say you have a Cloud Function https://us-central1-<your-project-id>.cloudfunctions.net/bigben . 假设你有一个云功能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 . 建立此连接后,该功能也将在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托管相关联,则该功能也可以在https://<your-custom-domain>.com/bigben

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将客户端 firebase 云消息传递令牌获取到谷歌云 function? - How do you get client-side firebase cloud messaging token into google cloud function? 如何根据URL和Vanity URL将活动类添加到锚标记? - How to add an active class to an anchor tag based on URL and Vanity URLs? 如何使用 firebase.on() function 制作 promise? - How do you make a promise with firebase .on() function? 云功能,用于从Firebase数据库添加/删除文件的URL,该文件已添加到Firebase存储/从Firebase存储中删除 - Cloud function to add/remove the url of a file from Firebase Database that has been added to/removed from Firebase Storage 如何使用云功能将子级添加到Firebase实时数据库的列表中? - How to add child to a List in Firebase Realtime Database with a cloud function? 我如何处理 firebase 云 function api oncall 的错误? - how do i handle the error for firebase cloud function api oncall? 如何在云端功能中查询Firebase数据库? - How do I query a firebase database inside a cloud function? 如何批量删除 Firebase 云 function 中的 Firestore 文档 - How to do a Batch delete Firestore Documents in a Firebase cloud function 您如何在 firebase firestore 功能中列出所有用户 - How do you list all users in firebase firestore function 如何将参数添加到URL并重新加载页面 - How do you add a parameter to a URL and reload the page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM