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 从公开仓库中收录这些内容。

举报或申请下架