firebase-hosting-basics

โดย firebase

ปรับใช้ไซต์แบบคงที่, SPA และไมโครเซอร์วิสไปยัง CDN ทั่วโลกด้วย SSL ที่ไม่ต้องกำหนดค่า รองรับไซต์แบบคงที่, แอปหน้าเดียว (React, Vue ฯลฯ) และเนื้อหาแบบไดนามิกผ่าน Cloud Functions หรือการรวม Cloud Run รวมถึงช่องทางพรีวิวสำหรับทดสอบการเปลี่ยนแปลงบน URL ชั่วคราวก่อนการปรับใช้จริง พร้อมระบบอัตโนมัติของ GitHub Actions กำหนดค่าการกำหนดเส้นทาง, การเปลี่ยนเส้นทาง, การเขียนซ้ำ และส่วนหัวผ่าน firebase.json ; จำลองในเครื่องที่ http://localhost:5000 ก่อนปรับใช้ ไม่ได้มีไว้สำหรับเฟรมเวิร์กแบบฟูลสแต็ก...

npx skills add https://github.com/firebase/agent-skills --skill firebase-hosting-basics

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.

2. Deploying

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

3. Emulation

To test your app locally:

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

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

Skills เพิ่มเติมจาก firebase

developing-genkit-dart
firebase
Unified AI SDK สำหรับ Dart ที่รองรับการสร้างโค้ด, ผลลัพธ์ที่มีโครงสร้าง, เครื่องมือ, โฟลว์, และเอเจนต์ ให้ API หลักสำหรับการสร้าง, การกำหนดเครื่องมือ, การจัดระเบียบโฟลว์, การฝังข้อมูล, และการสตรีมด้วยอินเทอร์เฟซเดียว รวมถึงปลั๊กอิน 8+ ตัวสำหรับผู้ให้บริการ LLM (Google Gemini, Anthropic Claude, OpenAI GPT), Firebase AI, Model Context Protocol, การรวมเบราว์เซอร์ Chrome, และการโฮสต์เซิร์ฟเวอร์ HTTP ผ่าน Shelf มี CLI ในตัวพร้อม UI สำหรับการพัฒนาในเครื่องสำหรับการดำเนินการโฟลว์, การติดตาม, การทดลองโมเดล, และ...
official
developing-genkit-js
firebase
สร้างแอปพลิเคชัน Node.js/TypeScript ที่ขับเคลื่อนด้วย AI ด้วย Genkit flows, tools และการรองรับหลายโมเดล Genkit ไม่ยึดติดกับผู้ให้บริการ รองรับ Google AI, OpenAI, Anthropic, Ollama และผู้ให้บริการ LLM อื่นๆ ผ่านปลั๊กอิน กำหนด flows ด้วยสคีมาที่ปลอดภัยชนิดข้อมูลโดยใช้ Zod ดำเนินการสร้างคำขอ และประกอบเวิร์กโฟลว์ AI แบบหลายขั้นตอนใน TypeScript ต้องใช้ Genkit CLI v1.29.0+ การเปลี่ยนแปลง API หลักเมื่อเร็วๆ นี้หมายความว่าคุณต้องปรึกษา genkit docs:read และ common-errors.md สำหรับรูปแบบปัจจุบัน ไม่ใช่ความรู้เดิม...
official
extension-to-functions-codebase
firebase
ทักษะสำหรับการแปลง Firebase Extension ที่ติดตั้งแล้ว (หรือซอร์สของ extension) ให้เป็นโค้ดเบส Cloud Functions for Firebase แบบสแตนด์อโลน หรือแพ็กเกจ npm ที่เผยแพร่ได้,…
official
firebase-ai-logic
firebase
การผสานรวม Gemini ฝั่งไคลเอ็นต์สำหรับเว็บแอปพลิเคชัน รองรับการอนุมานแบบหลายรูปแบบ การสตรีม และการทำงานแบบไฮบริดบนอุปกรณ์ รองรับอินพุตแบบข้อความเท่านั้นและแบบหลายรูปแบบ (รูปภาพ เสียง วิดีโอ PDF) ไฟล์ที่เกิน 20 MB จะถูกส่งผ่าน Cloud Storage รวมถึงเซสชันแชทที่มีประวัติอัตโนมัติ การตอบสนองแบบสตรีมสำหรับการแสดงผลแบบเรียลไทม์ และการบังคับใช้เอาต์พุต JSON ที่มีโครงสร้าง รองรับการอนุมานแบบไฮบริดบนอุปกรณ์ผ่าน Gemini Nano ใน Chrome โดยจะเปลี่ยนไปใช้การทำงานบนคลาวด์โดยอัตโนมัติ ต้องใช้ App Check สำหรับการใช้งานจริง...
official
firebase-ai-logic-basics
firebase
ทักษะอย่างเป็นทางการสำหรับการรวม Firebase AI Logic (Gemini API) เข้ากับเว็บแอปพลิเคชัน ครอบคลุมการตั้งค่า การอนุมานแบบหลายรูปแบบ ผลลัพธ์ที่มีโครงสร้าง และความปลอดภัย
official
firebase-app-hosting-basics
firebase
ปรับใช้และจัดการเว็บแอปแบบฟูลสแต็กด้วย Firebase App Hosting โดยใช้ Next.js, Angular และเฟรมเวิร์กอื่นๆ ที่รองรับ ต้องมีโปรเจกต์ Firebase ในแผนราคา Blaze รองรับการทำงาน Server-Side Rendering (SSR) และ Incremental Static Regeneration (ISR) ปรับใช้ผ่านการกำหนดค่า firebase.json พร้อม apphosting.yaml สำหรับตั้งค่าแบ็กเอนด์ หรือเปิดใช้งาน "git push to deploy" อัตโนมัติผ่าน GitHub รวมถึงการจัดการความลับผ่านคำสั่ง CLI เพื่อการเข้าถึงคีย์ที่ละเอียดอ่อนอย่างปลอดภัย...
official
firebase-auth-basics
firebase
ตั้งค่า Firebase Authentication กับผู้ให้บริการหลายรายและกฎการเข้าถึงข้อมูลที่ปลอดภัย รองรับอีเมล/รหัสผ่าน, เบอร์โทรศัพท์, ไม่ระบุตัวตน, ผู้ให้บริการแบบรวม (Google, Facebook, Twitter, GitHub, Microsoft, Apple) และการรวมระบบการยืนยันตัวตนแบบกำหนดเอง ผู้ใช้ที่ได้รับการยืนยันตัวตนแต่ละคนจะได้รับ ID เฉพาะและโทเค็นแบบ JWT (โทเค็น ID อายุสั้นและโทเค็นรีเฟรชอายุยาว) สำหรับการเข้าถึงบริการ Firebase เปิดใช้งานผู้ให้บริการผ่าน CLI สำหรับ Google Sign In, ไม่ระบุตัวตน และอีเมล/รหัสผ่าน; ใช้ Firebase Console...
official
firebase-basics
firebase
การตั้งค่าโปรเจกต์ Firebase และขั้นตอนการทำงาน CLI สำหรับการรวม AI agent ต้องทำทักษะ firebase-local-env-setup ให้เสร็จก่อน และติดตั้ง Firebase CLI ขั้นตอนหลักครอบคลุมการยืนยันตัวตนผ่าน firebase login การสร้างโปรเจกต์ด้วย ID ที่ไม่ซ้ำกัน และการเริ่มต้นบริการผ่านคำสั่ง firebase init แบบโต้ตอบ รองรับการเลือกฟีเจอร์ระหว่างการตั้งค่ารวมถึง Firestore, Functions และ Hosting พร้อมการสร้างไฟล์กำหนดค่าอัตโนมัติ CLI ที่มีเอกสารในตัวพร้อมแฟล็ก --help สำหรับ...
official