为 Google Cloud Function 使用自定义域 [英] Use custom domain for Google Cloud Function

查看:27
本文介绍了为 Google Cloud Function 使用自定义域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 HTTP 触发器时,我在任何地方都看不到为我的 Google Cloud Function 设置自定义域的任何选项.似乎是一个相当大的遗漏.有什么方法可以使用自定义域而不是他们的 location-project.cloudfunctions.net 域或一些解决方法来达到相同的效果?

I can't see any option anywhere to set up a custom domain for my Google Cloud Function when using HTTP Triggers. Seems like a fairly major omission. Is there any way to use a custom domain instead of their location-project.cloudfunctions.net domain or some workaround to the same effect?

我读过一篇文章,建议在函数前面使用 CDN,并将函数 URL 指定为拉区.这可行,但会带来不必要的成本 - 在我的场景中,任何内容都无法缓存,因此使用 CDN 远非理想.

I read an article suggesting using a CDN in front of the function with the function URL specified as the pull zone. This would work, but would introduce unnecessary cost - and in my scenario none of the content is able to be cached so using a CDN is far from ideal.

推荐答案

如果您将您的 Cloud 项目与 Firebase 连接,您可以将您的 HTTP 触发的云函数连接到 Firebase 托管以获得虚荣网址.

If you connect your Cloud project with Firebase, you can connect your HTTP-triggered Cloud Functions to Firebase Hosting to get vanity URLs.

这篇关于为 Google Cloud Function 使用自定义域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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