Firebase Hosting is a service that lets you quickly deploy and serve web content like HTML, CSS, and JavaScript files with a secure and fast global network.
Click to reveal answer
beginner
Which command initializes Firebase Hosting in your project?
The command firebase init hosting sets up Firebase Hosting in your project by creating necessary configuration files.
Click to reveal answer
intermediate
What file does Firebase Hosting use to configure which files to deploy?
Firebase Hosting uses the firebase.json file to specify which files and folders to deploy and how to handle rewrites or redirects.
Click to reveal answer
beginner
How do you deploy your website to Firebase Hosting?
You deploy your website by running firebase deploy --only hosting, which uploads your files to Firebase servers and makes your site live.
Click to reveal answer
intermediate
Why is it important to set the correct public directory during Firebase Hosting setup?
Setting the correct public directory ensures Firebase deploys the right folder containing your website files, so your site loads correctly when visited.
Click to reveal answer
Which Firebase CLI command starts the hosting setup process?
Afirebase init hosting
Bfirebase deploy
Cfirebase serve
Dfirebase login
✗ Incorrect
The command firebase init hosting initializes hosting setup by creating config files.
What does the firebase deploy --only hosting command do?
ALogs you into Firebase
BDeploys all Firebase services
CStarts a local server
DDeploys only the hosting files to Firebase
✗ Incorrect
This command uploads only the hosting files to Firebase servers, making your site live.
Where do you specify which folder contains your website files for Firebase Hosting?
Aindex.html
B.firebaserc
Cfirebase.json
Dpackage.json
✗ Incorrect
The firebase.json file configures the public directory for hosting.
What is the default public directory name suggested by Firebase Hosting?
Asrc
Bpublic
Cdist
Dassets
✗ Incorrect
Firebase Hosting suggests public as the default folder to serve your site files.
Which Firebase Hosting feature helps serve your site quickly worldwide?
AGlobal CDN (Content Delivery Network)
BRealtime Database
CCloud Functions
DAuthentication
✗ Incorrect
Firebase Hosting uses a global CDN to deliver your site fast to users everywhere.
Explain the steps to set up and deploy a website using Firebase Hosting.
Think about initialization, configuration, and deployment commands.
You got /5 concepts.
Why is choosing the correct public directory important in Firebase Hosting setup?
Consider what happens if the wrong folder is deployed.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of Firebase Hosting?
easy
A. To create databases for mobile apps
B. To write backend server code
C. To publish websites online without managing servers
D. To monitor app performance
Solution
Step 1: Understand Firebase Hosting's role
Firebase Hosting is designed to host and serve web content easily without needing to manage servers.
Step 2: Differentiate from other Firebase services
Other services like databases or backend code are separate from Hosting's purpose.
Final Answer:
To publish websites online without managing servers -> Option C
Quick Check:
Firebase Hosting = publish websites without servers [OK]
Hint: Remember Hosting is for websites, not databases or code [OK]
Common Mistakes:
Confusing Hosting with Firebase database services
Thinking Hosting manages backend code
Assuming Hosting monitors app performance
2. Which command initializes Firebase Hosting in your project?
easy
A. firebase init hosting
B. firebase deploy --only hosting
C. firebase start hosting
D. firebase create hosting
Solution
Step 1: Identify the initialization command
The command to set up Firebase Hosting configuration is firebase init hosting.
Step 2: Differentiate from deployment commands
firebase deploy --only hosting publishes the site but does not initialize it.
Final Answer:
firebase init hosting -> Option A
Quick Check:
Initialize Hosting = firebase init hosting [OK]
Hint: Init sets up Hosting; deploy publishes it [OK]
Common Mistakes:
Using deploy command to initialize
Assuming 'firebase start hosting' exists
Confusing create with init
3. After running firebase deploy --only hosting, what happens?
medium
A. Firebase deletes your local project files
B. Your website files are uploaded and become live at a Firebase URL
C. Your database is reset to default
D. Firebase Hosting configuration is removed
Solution
Step 1: Understand the deploy command effect
The deploy command uploads your site files to Firebase Hosting and makes the site live.
Step 2: Eliminate incorrect options
Deploy does not delete local files, reset databases, or remove configuration.
Final Answer:
Your website files are uploaded and become live at a Firebase URL -> Option B
Quick Check:
Deploy Hosting = upload and go live [OK]
Hint: Deploy publishes your site live on Firebase URL [OK]
Common Mistakes:
Thinking deploy deletes local files
Confusing deploy with database reset
Assuming deploy removes Hosting setup
4. You ran firebase deploy --only hosting but your site did not update. What is a likely cause?
medium
A. You deployed to the wrong Firebase project
B. Your internet connection was too fast
C. You forgot to run firebase init hosting first
D. Firebase Hosting does not support updates
Solution
Step 1: Check project targeting
If you deploy to the wrong Firebase project, your site won't update as expected.
Step 2: Rule out other options
Init is needed only once; internet speed does not block updates; Hosting supports updates.
Final Answer:
You deployed to the wrong Firebase project -> Option A
Quick Check:
Wrong project deploy = no site update [OK]
Hint: Verify project ID before deploying [OK]
Common Mistakes:
Assuming init must run every deploy
Blaming internet speed for deployment failure
Thinking Hosting can't update sites
5. You want to deploy only your website without affecting other Firebase services. Which command should you use?
hard
A. firebase deploy
B. firebase deploy --only database
C. firebase deploy --except hosting
D. firebase deploy --only hosting
Solution
Step 1: Understand deployment scope flags
The --only hosting flag deploys just the Hosting service, leaving others untouched.
Step 2: Compare other options
firebase deploy deploys all configured services; --only database deploys only database; --except hosting deploys all except Hosting.
Final Answer:
firebase deploy --only hosting -> Option D
Quick Check:
Deploy only Hosting = firebase deploy --only hosting [OK]
Hint: Use --only hosting to deploy just the website [OK]
Common Mistakes:
Running deploy without --only and affecting all services
Using --only database instead of hosting
Using --except hosting to deploy Hosting
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.