0
0
Firebasecloud~30 mins

Custom domain configuration in Firebase - Mini Project: Build & Apply

Choose your learning style9 modes available
Custom Domain Configuration in Firebase Hosting
📖 Scenario: You have a website hosted on Firebase Hosting with the default Firebase domain. Now, you want to use your own custom domain so visitors can access your site with a friendly web address like www.example.com.
🎯 Goal: Configure a custom domain for your Firebase Hosting project by setting up the domain data, adding verification configuration, applying the domain to Firebase Hosting, and completing the setup with DNS records.
📋 What You'll Learn
Create a dictionary called custom_domain with keys domain_name and verification_token.
Add a configuration variable called firebase_project_id with the exact value my-firebase-project.
Create a dictionary called firebase_hosting_config that includes the project_id and the custom_domain dictionary.
Add a dictionary called dns_records with keys CNAME and TXT for DNS verification and routing.
💡 Why This Matters
🌍 Real World
Custom domains make your website easier to find and look professional by using your own web address instead of a default Firebase URL.
💼 Career
Understanding how to configure custom domains is essential for cloud engineers and web developers managing web hosting and domain name systems.
Progress0 / 4 steps
1
Create the custom domain data
Create a dictionary called custom_domain with the exact keys and values: 'domain_name': 'www.example.com' and 'verification_token': 'firebase-verification-12345'.
Firebase
Need a hint?

Use curly braces to create a dictionary with the exact keys and values.

2
Add Firebase project ID configuration
Add a variable called firebase_project_id and set it to the exact string 'my-firebase-project'.
Firebase
Need a hint?

Assign the exact string to the variable firebase_project_id.

3
Create Firebase Hosting configuration dictionary
Create a dictionary called firebase_hosting_config with keys project_id set to firebase_project_id and custom_domain set to the custom_domain dictionary.
Firebase
Need a hint?

Use the variables you created to build the configuration dictionary.

4
Add DNS records for domain verification and routing
Create a dictionary called dns_records with keys CNAME set to 'ghs.googlehosted.com' and TXT set to the verification_token from custom_domain.
Firebase
Need a hint?

Use the verification token from the custom_domain dictionary for the TXT record.