mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-04 16:35:27 +08:00
fix: Set Vercel output directory to static/admin and update deployment documentation to clarify this configuration.
This commit is contained in:
15
DEPLOY.en.md
15
DEPLOY.en.md
@@ -132,6 +132,21 @@ Another common root cause (Go monorepo + `internal/`):
|
||||
This usually happens when the Vercel Go entrypoint imports `internal/...` directly.
|
||||
This repo now avoids that by using a public bridge package: `api/index.go` -> `ds2api/app` -> `internal/server`.
|
||||
|
||||
If you see:
|
||||
|
||||
```text
|
||||
No Output Directory named "public" found after the Build completed.
|
||||
```
|
||||
|
||||
Vercel is validating frontend output against `public`, while this repo emits WebUI assets to `static/admin`.
|
||||
`vercel.json` now explicitly sets:
|
||||
|
||||
```json
|
||||
"outputDirectory": "static/admin"
|
||||
```
|
||||
|
||||
If you manually changed Output Directory in Project Settings, set it to `static/admin` (or clear it and let repo config apply).
|
||||
|
||||
## 4. Reverse Proxy (Nginx)
|
||||
|
||||
Disable buffering for SSE:
|
||||
|
||||
14
DEPLOY.md
14
DEPLOY.md
@@ -131,6 +131,20 @@ Error: Command failed: go build -ldflags -s -w -o .../bootstrap .../main__vc__go
|
||||
这通常发生在 Vercel Go 入口文件直接 `import internal/...`。
|
||||
当前仓库已通过公开桥接包 `app` 解决:`api/index.go` -> `ds2api/app` -> `internal/server`。
|
||||
|
||||
若看到类似报错:
|
||||
|
||||
```text
|
||||
No Output Directory named "public" found after the Build completed.
|
||||
```
|
||||
|
||||
说明 Vercel 正在按 `public` 校验前端产物目录。当前仓库前端产物目录是 `static/admin`,已在 `vercel.json` 显式配置:
|
||||
|
||||
```json
|
||||
"outputDirectory": "static/admin"
|
||||
```
|
||||
|
||||
若你在项目设置里手动改过 Output Directory,请同步改为 `static/admin` 或清空让仓库配置生效。
|
||||
|
||||
## 4. 反向代理(Nginx)
|
||||
|
||||
如果在 Nginx 后挂载,建议关闭缓冲以保证 SSE:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"version": 2,
|
||||
"buildCommand": "npm ci --prefix webui && npm run build --prefix webui",
|
||||
"outputDirectory": "static/admin",
|
||||
"functions": {
|
||||
"api/index.go": {
|
||||
"includeFiles": "static/admin/**"
|
||||
|
||||
Reference in New Issue
Block a user