Firebase hosting - sana028/VueLearningsPoc GitHub Wiki
Firebase Hosting:
firebase hosting is a fully managed hosting service for static and dynamic content. The service is backend by SSD and global CDN, zero configuration ssl, so content can always deploy securely.
Build then host your microservices, API, and forms
Pair Firebase Hosting with Cloud Functions to build microservices using the Express.js framework.
we can host the api's and functions also.
To connect local directory with your firebase project .
firebase init hosting
choose configurations according to you needs.
if you want deploy only hosting
firebase deploy --only hosting
preview and share
if we want to see our local changes by others we can deploy the changes in a preview channel URL which is a temporary URL.
once we deploy the app at preview channel
firebase hosting:channel:deploy channel-Id
this will generate a temporary url which can sharable to any one. This preview URL can be connect with your real time db.
Add predeploy and postdeploy scripted tasks
You can optionally connect shell scripts to the firebase deploy command to perform predeploy or postdeploy tasks. For example, a postdeploy hook could notify administrators of new site content deploys. Refer to the Firebase CLI documentation for more details.
Serving over HTTPS
Firebase Hosting is SSL-only, meaning that content is only served over HTTPS.
The multisite feature supports a maximum of 36 sites per Firebase project.
Note
Note the following about connecting custom domains: Each custom domain can only be connected to one Hosting site. Each custom domain is limited to having 20 subdomains per apex domain, due to SSL certificate minting limits.
Specify which files to deploy
in firebase .json, in hosting object we can define which will ignore at the time of deployment so using this way we can deploy those files which are needed.
Configure rewrites Optional Use a rewrite to show the same content for multiple URLs.