Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firebase hosting multiple sites configure .firebaserc file

Tags:

I have firebase hosting working successfully in my project however I want to use the same database for a different site on a subdomain so I thought I would click add another site on firebase hosting.

I can configure the a records etc for the domain with no issues but am having trouble deploying content to the secondary site.

For example if I run firebase init and follow the prompts my .firebaserc looks the same in both my main project and my sub project.

{
  "projects": {
    "default": "<project-name-here>"
  }
}

Is there a way to tell the file which hosting site you are trying to deploy to? I have seen references to multiple databases here but I don't think this is relevant to what I am trying to do?

like image 217
ak85 Avatar asked Sep 03 '18 12:09

ak85


1 Answers

You need to set deployment targets:

firebase target:apply hosting target-name resource-name

Where the parameters are:

  • target-name — a unique identifier (that you've defined yourself) for the Hosting site that you're deploying to

  • resource-name — the name of the Hosting site as listed in your Firebase project


Let me know if it works!

Source: https://firebase.google.com/docs/hosting/multisites

like image 158
Saxon B Avatar answered Sep 19 '22 16:09

Saxon B