You have a Firebase project and want to host two different websites under the same project. How does Firebase manage this?
Think about how configuration files define hosting behavior.
Firebase supports multiple sites in one project by defining multiple hosting targets in the firebase.json file. Each target points to a different folder, allowing separate sites under one project.
Choose the firebase.json snippet that correctly configures hosting for two sites: 'main' and 'blog', each with its own folder.
Look for the correct use of 'target' and array structure.
The correct firebase.json uses an array under 'hosting' with objects specifying 'target' and 'public' keys for each site.
You configure two hosting targets with the same public directory and deploy both. What is the expected behavior?
Think about file system behavior when writing to the same folder twice.
Deploying multiple sites with the same public directory causes the last deployment to overwrite files, leading to conflicts and unexpected behavior.
You have two sites hosted in one Firebase project. You want to restrict access to one site only to authenticated users. How can you achieve this?
Think about how hosting can control routing and access based on user state.
Firebase Hosting can use rewrite rules combined with Firebase Authentication to restrict access by redirecting unauthenticated users to login pages.
You have multiple sites hosted in one Firebase project for different environments (dev, staging, production). How should you manage environment-specific settings like API keys or feature flags?
Consider how static files and deployment targets can separate environments.
Best practice is to use separate hosting targets with distinct public folders for each environment, each containing its own config files, ensuring clean separation and easy deployment.