[英]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.