From 6ffce274e73d61c042862043b991bfa3318f17b3 Mon Sep 17 00:00:00 2001 From: anghunk Date: Thu, 22 Jan 2026 11:58:45 +0800 Subject: [PATCH] =?UTF-8?q?docs(backend-config):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E9=85=8D=E7=BD=AE=E5=8F=82=E8=80=83=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加完整的后端配置参考模板,方便部署时对照检查参数 --- docs/guide/backend-config.md | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/docs/guide/backend-config.md b/docs/guide/backend-config.md index 2b8a030..a42ce52 100644 --- a/docs/guide/backend-config.md +++ b/docs/guide/backend-config.md @@ -118,3 +118,45 @@ CWD 评论部署成功,当前版本... - 在 `Environment Variables` 中添加 `ADMIN_NAME`、`ADMIN_PASSWORD` 等变量 - 在 `D1 Databases` 中绑定 `CWD_DB`(默认已配置好) - 在 `KV Namespaces` 中绑定 `CWD_AUTH_KV`(默认已配置好) + + +## 参考模板 + +一份完整的参考模板,如遇到部署问题可以对照参数进行检查。 + +```jsonc +{ + "$schema": "node_modules/wrangler/config-schema.json", + "name": "cwd-api", + "main": "src/index.ts", + "compatibility_date": "2026-01-03", + "compatibility_flags": [ + "nodejs_compat" + ], + "workers_dev": true, + "preview_urls": true, + "send_email": [ + { + "name": "SEND_EMAIL" + } + ], + "d1_databases": [ + { + "binding": "CWD_DB", + "database_name": "CWD_DB", + "database_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "remote": true + } + ], + "kv_namespaces": [ + { + "binding": "CWD_AUTH_KV", + "id": "xxxxxxxxxxxxxxxxxxxxxxx" + } + ], + "vars": { + "ADMIN_NAME": "admin@example.com", + "ADMIN_PASSWORD": "123456" + } +} +``` \ No newline at end of file