|
1 | 1 | #:schema ./node_modules/wrangler/config-schema.json |
| 2 | + |
| 3 | +# =============================== |
| 4 | +# 🌐 THÔNG TIN CƠ BẢN |
| 5 | +# =============================== |
2 | 6 | name = "cloudflare-docs" |
3 | 7 | account_id = "b54f07a6c269ecca2fa60f1ae4920c99" |
4 | | -compatibility_date = "2024-10-14" |
5 | | -compatibility_flags = ["nodejs_compat"] |
6 | 8 | main = "./worker/index.ts" |
7 | 9 |
|
8 | | -workers_dev = true |
| 10 | +# =============================== |
| 11 | +# ⚙️ CẤU HÌNH MÔI TRƯỜNG |
| 12 | +# =============================== |
| 13 | +compatibility_date = "2024-01-29" |
| 14 | +compatibility_flags = ["nodejs_compat"] |
| 15 | +workers_dev = true # true = test trên .workers.dev, false = deploy domain thật |
| 16 | + |
| 17 | +# =============================== |
| 18 | +# 🌍 ROUTE – DOMAIN TRIỂN KHAI |
| 19 | +# =============================== |
9 | 20 | route = { pattern = "developers.cloudflare.com/*", zone_name = "developers.cloudflare.com" } |
10 | 21 |
|
| 22 | +# =============================== |
| 23 | +# 📦 QUY TẮC XỬ LÝ FILE |
| 24 | +# =============================== |
11 | 25 | rules = [ |
12 | | - { type = "Text", globs = ["**/__redirects"], fallthrough = true }, |
| 26 | + { type = "Text", globs = ["**/__redirects"], fallthrough = true }, |
13 | 27 | ] |
14 | 28 |
|
| 29 | +# =============================== |
| 30 | +# 🧱 ASSETS – PHỤC VỤ WEBSITE TĨNH |
| 31 | +# =============================== |
15 | 32 | [assets] |
16 | | -directory = "./dist" |
17 | | -binding = "ASSETS" |
18 | | -not_found_handling = "404-page" |
19 | | -run_worker_first = true |
| 33 | +directory = "./dist" # Thư mục chứa file build sẵn (HTML, CSS, JS) |
| 34 | +binding = "ASSETS" # Biến truy cập trong code: env.ASSETS |
| 35 | +not_found_handling = "404-page" # Trang 404 tùy chỉnh |
| 36 | +run_worker_first = true # Worker xử lý logic trước khi trả file tĩnh |
20 | 37 |
|
| 38 | +# =============================== |
| 39 | +# ☁️ R2 BUCKET – LƯU TRỮ DỮ LIỆU |
| 40 | +# =============================== |
21 | 41 | [[r2_buckets]] |
22 | | -binding = "VENDORED_MARKDOWN" |
23 | | -bucket_name = "vendored-markdown" |
| 42 | +binding = "VENDORED_MARKDOWN" # Biến truy cập trong code: env.VENDORED_MARKDOWN |
| 43 | +bucket_name = "vendored-markdown" # Tên bucket R2 thật trên Cloudflare |
24 | 44 |
|
| 45 | +# =============================== |
| 46 | +# 📊 GIÁM SÁT & LOG |
| 47 | +# =============================== |
25 | 48 | [observability] |
26 | 49 | enabled = true |
0 commit comments