Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include subdirectories in firebase hosting

My site consists of main page and then subages separated inside folders. How can I include subpages in my page host (firebase hosting)

like image 977
maticzav Avatar asked Oct 31 '15 16:10

maticzav


People also ask

Can I change Firebase hosting URL?

You can't change your domain, but you can change the host! You can make as many sites as you want.

Where do I put Firebase json?

JSON files are usually kept at the root in react native projects in their native folders and in android we keep that inside the app folder, and try giving them relative path.


Video Answer


3 Answers

(Frank's comment was really an answer)

Firebase deploys everything under the directory that you indicate. So if you have your main page (index.html) in the current and directory and the other pages in subdirectories under that, they should all be deployed if you configure public to point to the current directory.

Deployment Configuration

like image 123
mckoss Avatar answered Nov 14 '22 23:11

mckoss


Update Node (npm) and Firebase CLI tools

We had a problem related to this... After some time of no relation with Firebase we created a similar new project and uploaded the new files for the hosting. All seemed to work fine, except for ONE thing: sub-directories of the hosting simply didn't appear to have loaded, even when the number of files was correct on the Hosting section of the console.

After more than one day of updating all projects files, looking for answer (like in here) and more tests, we finally also updated NodeJS (npm) and Firebase CLI tools... that solved the problem.

So, always update the framework first.

like image 23
DavidTaubmann Avatar answered Nov 14 '22 23:11

DavidTaubmann


For me it was a browser cache issue (with pwa), when I used a different browser it worked. And yes, I changed my firebase.json to this (it was "public": "public"):

{
  "hosting": {
    "public": ".",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}
like image 39
Eli Avatar answered Nov 14 '22 21:11

Eli