Complete the code to initialize Firebase Hosting configuration.
firebase init [1]Firebase Hosting is initialized using the hosting option during setup.
Complete the code to deploy your web app to Firebase Hosting.
firebase deploy --only [1]To deploy a web app, you use firebase deploy --only hosting.
Fix the error in the Firebase Hosting configuration file to serve the app correctly.
{
"hosting": {
"public": "[1]",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
}
}The public folder is where Firebase Hosting looks for your web app files by default.
Fill both blanks to configure Firebase Hosting to serve a single-page app correctly.
{
"hosting": {
"public": "[1]",
"rewrites": [
{ "source": "**", "destination": "[2]" }
]
}
}Firebase Hosting serves files from the public folder and rewrites all routes to index.html for single-page apps.
Fill all three blanks to create a Firebase Hosting configuration that serves a web app with caching and SPA support.
{
"hosting": {
"public": "[1]",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{ "source": "**", "destination": "[2]" }
],
"headers": [
{
"source": "**/*.@(js|css)",
"headers": [
{ "key": "Cache-Control", "value": "[3]" }
]
}
]
}
}The public folder holds the app files, index.html is the SPA entry point, and caching static files with max-age=31536000, immutable improves performance.