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

查看:70
本文介绍了对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 Hosting 以获取虚荣心网址.

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天全站免登陆