Firebase hosting with multiple directories at multiple domains

无人久伴 提交于 2019-11-26 16:24:33

问题


I have the following setup and wanted to know how to best configure Firebase hosting

I have a repo with the /build directory with three subdirectories:

  • /build/a
  • /build/b
  • /build/c

I'd like to serve each directory at its own domain (or domain) in both prod and dev like:

  • /a
    • Prod: foo.com and www.foo.com
    • Dev: dev.foo.com
  • /b
    • Prod: b.foo.com
    • Dev: b.dev.foo.com
  • /c
    • Prod: c.foo.com
    • Dev: c.dev.foo.com

It seems like the only way to do this is to create a separate Firebase project for each deployed directory (6 total), with a separate firebase.json for each directory (3 total)

Is there a better way to do this?

Thanks


回答1:


This would require setting up six projects (one for each prod/dev environment) and three firebase.json files. You can associate multiple domains with a single site, but at present you cannot have multiple sites in the same project. This is something that we're looking into supporting in the future, but there's nothing to announce at this time.




回答2:


You can host multiple site on Firebase now.
https://firebase.google.com/docs/hosting/multisites?authuser=0



来源:https://stackoverflow.com/questions/43581735/firebase-hosting-with-multiple-directories-at-multiple-domains

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!