From 00ba69d89988141a326e24a773942f02aa9090c7 Mon Sep 17 00:00:00 2001 From: JianFeeeee Date: Wed, 2 Sep 2026 10:33:03 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=AF=B4=E6=98=8E=E6=96=B0=E5=85=8B?= =?UTF-8?q?=E9=9A=86=E5=8F=AF=E7=9B=B4=E6=8E=A5=E7=BC=96=E8=AF=91=EF=BC=88?= =?UTF-8?q?static/=20=E7=95=99=E4=BA=86=E5=8D=A0=E4=BD=8D=E9=A1=B5?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++- gateway/internal/static/static/index.html | 72 +++-------------------- 2 files changed, 15 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index e51eead..617f0a7 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,13 @@ npm 只在构建期用到:Node ≥ 18(`npm run build`)与 Go ≥ 1.22。 `web/dist` 会被复制进 `gateway/internal/static/static/` 再由 `go:embed` 编入二进制, **部署机上不需要 node**。 -`web/node_modules`、`web/dist`、`gateway/internal/static/static/` 与编译出的二进制都是 -构建产物,不进版本库(见 `.gitignore`)。因此**克隆后必须先跑一次 `deploy/install.sh`** -——`go:embed` 要求那个目录存在才能编译,否则 `go build` 直接失败。只想编 Go 的话: +`web/node_modules`、`web/dist`、`gateway/internal/static/static/` 的内容与编译出的二进制 +都是构建产物,不进版本库(见 `.gitignore`)。 + +新克隆**可以直接 `go build` / `go test`**:`static/` 目录里留了一个占位 index.html +(`go:embed` 要求目标目录存在,否则编译失败——只改后端的人不该被迫先装 node)。 +此时打开网页看到的是「前端未构建」提示页,API 照常可用。要真正的界面就跑 +`deploy/install.sh`,或手工: ```bash cd web && npm ci && npm run build diff --git a/gateway/internal/static/static/index.html b/gateway/internal/static/static/index.html index 41b402a..9b0440e 100644 --- a/gateway/internal/static/static/index.html +++ b/gateway/internal/static/static/index.html @@ -1,69 +1,13 @@ - - + - - - AgentMail — 前端未构建 - + + + AgentMail + + - -
-

AgentMail 前端未构建

-

- 当前二进制里嵌入的是占位页。后端 API 仍然可用(/api/v1、 - /health)。 -

-

构建并嵌入前端:

-
sudo ./deploy/install.sh
-

或者手工:

-
cd web && npm ci && npm run build
-rm -rf ../gateway/internal/static/static
-cp -r dist ../gateway/internal/static/static
-cd ../gateway && go build ./cmd/server
-

- 构建产物不进版本库;这个占位文件的存在只是为了让 - go:embed 在新克隆里能编译通过。 -

-
+ +