Update server, embed, gitignore

This commit is contained in:
yuqianhe
2026-06-10 03:54:15 +00:00
parent 0d3913706b
commit cbf590cd83
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@@ -1,5 +1,6 @@
# Binary # Binary
api-server api-server
api-server*
# Runtime data # Runtime data
data/ data/

View File

@@ -111,8 +111,8 @@ func New(cfg *config.Config) (*Server, error) {
return return
} }
// 视频网站子路由 → videoapp SPA // 视频网站子路由 → videoapp SPA(精确避免匹配 /videoapp/
if strings.HasPrefix(path, "/video") { if path == "/video" || strings.HasPrefix(path, "/video/") {
serveStaticFile(c, "videoapp/index.html") serveStaticFile(c, "videoapp/index.html")
return return
} }

View File

@@ -6,7 +6,7 @@ import (
"log" "log"
) )
//go:embed static/* //go:embed static
var embedFS embed.FS var embedFS embed.FS
// StaticFS 嵌入式前端静态文件(根路径已去除 static/ 前缀) // StaticFS 嵌入式前端静态文件(根路径已去除 static/ 前缀)