Using Firebase to host multi website

Initiate your project

cd into your working directory, using firebaes init to initiate your website. Then three files will appear under your folder, “.firebaserc”, “.gitignore” and “firebase.json”.

Change your setting

In “firebase.json” file, it contains your hosting settings. a configuration example below:

{
"hosting": {
"site": "XXXXXXX", // the site name in your Firebase console
"public": "build",
"ignore": [
"firebase.json",
"
/.*", "/node_modules/" ], "rewrites": [ { "source": "",
"destination": "/index.html"
}
]
}
}

You should config “site” attribute adhering to your firebase site name.

Deploy to server

Using firebase deploy command to deploy your project into the site which you set up on your firebase console.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.