← Foundations Course

SYSTEM FOUNDATIONS · 01

網站如何上線:從本機檔案到公開網址

第一課先建立全局地圖,不急著學協定細節。你只需要先知道:你寫的是檔案;GitHub 保存版本;部署平台把 build artifact 放到能回應網路請求的環境;domain/DNS 讓使用者找到它。

Learning outcomes

1. 你真正寫的是檔案

project/
  index.html
  styles.css
  app.js

這些檔案存在你的電腦上,不會因為你存檔就自動出現在 Internet。Browser 用 file:// 打開本機檔案,和使用 https:// 造訪公開網站是不同路徑。

2. Git / GitHub 是版本與協作層

local files
  ↓ git commit
local repository
  ↓ git push
GitHub repository

GitHub 保存程式碼與版本歷史,但 repository 本身不等於 production website。還需要 build / deploy。

3. Deploy 把可服務的 Artifact 放到 Runtime

GitHub
  ↓ CI / build
dist/
  ↓ deploy
Cloud platform
  ↓ HTTPS
Public website

Static site 的 artifact 可能只是 HTML/CSS/JS;backend 則可能還要啟動長時間存活的 process。

4. Domain 是人類可讀名稱

example.com
   ↓ DNS
network destination
   ↓ HTTPS
deployed service

買 domain 不等於買 server;有 server 也不代表 domain 自動指向它。第 7 課會把 DNS 拆開。

5. 使用者看到頁面的最小旅程

BrowserrequestNetwork找到 serviceServer/CloudresponseBrowser render

Project checkpoint:Request Journey Map v1

User types:
https://example.com/courses

Current model:
Browser
  ↓
Internet
  ↓
Deployed website
  ↓
HTML/CSS/JS response
  ↓
Screen

接下來每課都在這張圖補一層,而不是另起一套名詞。

Debug evidence:網站打不開先不要亂猜

先問是哪一段失敗:source/build 根本沒產生?deploy 沒成功?公開 URL 回 404/500?還是 domain/DNS 指錯?這種「先切層」的習慣會貫穿整門課。

Knowledge check

  1. GitHub repository 為什麼不等於 production website?
  2. domain 和 server 各扮演什麼角色?
  3. 本機 index.html 能開,為什麼別人不一定能開?
  4. 畫出自己的 local → GitHub → deploy → public URL 路徑。