Firebase Hosting Basics

作者 firebaseeba80a3dc825無授權條款462 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫今天更新

Deploys and configures classic Firebase Hosting for static websites, single-page apps (SPAs), and microservices. Use when deploying static sites/SPAs, setting up custom domains, configuring firebase.json hosting settings (redirects, rewrites, headers, multi-site), or managing preview channels. Don't use for Firebase App Hosting (Next.js/SSR), Auth, Firestore queries/rules, Data Connect, or Crashlytics.

僅含說明DevOps & Cloud
AI 產生的概覽

指導部署與設定經典 Firebase Hosting,用於靜態網站、單頁應用程式與微服務。

功能
此技能提供使用經典 Firebase Hosting 的說明與參考資料。內容涵蓋 firebase.json 的託管設定,例如公開目錄、重新導向、重寫、標頭與多網站設定,以及部署網站、使用預覽頻道與管理發佈。它也提到透過 Firebase CLI 在本機模擬 Hosting。
適用情境
適用於部署靜態網站或單頁應用程式、設定自訂網域、設定 firebase.json 託管設定,或管理預覽頻道。它不適用於採用 SSR 框架的 Firebase App Hosting、Auth、Firestore 查詢或規則、Data Connect 或 Crashlytics。
執行需求
僅為說明文件,不隨附指令碼。它引用 Firebase CLI,例如透過 npx 執行 firebase-tools 進行本機 Hosting 模擬,並假設部署時已有 Firebase 專案。

hosting-basics

This skill provides instructions and references for working with Firebase Hosting, a fast and secure hosting service for your web app, static and dynamic content, and microservices.

Overview

Firebase Hosting provides production-grade web content hosting for developers. With a single command, you can deploy web apps and serve both static and dynamic content to a global CDN (content delivery network).

Key Features:

  • Fast Content Delivery: Files are cached on SSDs at CDN edges around the world.
  • Secure by Default: Zero-configuration SSL is built-in.
  • Preview Channels: View and test changes on temporary preview URLs before deploying live.
  • GitHub Integration: Automate previews and deploys with GitHub Actions.
  • Dynamic Content: Serve dynamic content and microservices using Cloud Functions or Cloud Run.

Hosting vs App Hosting

Choose Firebase Hosting if:

  • You are deploying a static site (HTML/CSS/JS).
  • You are deploying a simple SPA (React, Vue, etc. without SSR).
  • You want full control over the build and deploy process via CLI.

Choose Firebase App Hosting if:

  • You are using a supported full-stack framework like Next.js or Angular.
  • You need Server-Side Rendering (SSR) or ISR.
  • You want an automated "git push to deploy" workflow with zero configuration.

Instructions

1. Configuration (firebase.json)

For details on configuring Hosting behavior, including public directories, redirects, rewrites, and headers, see configuration.md [blocked].

2. Deploying

For instructions on deploying your site, using preview channels, and managing releases, see deploying.md [blocked].

3. Emulation

To test your app locally:

bash
npx -y firebase-tools@latest emulators:start --only hosting

This serves your app at http://localhost:5000 by default.

來源與署名

來源:firebase/agent-skills位於skills/firebase-hosting-basics提交eba80a3

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架