Update server, embed, gitignore
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
# Binary
|
||||
api-server
|
||||
api-server*
|
||||
|
||||
# Runtime data
|
||||
data/
|
||||
|
||||
@@ -111,8 +111,8 @@ func New(cfg *config.Config) (*Server, error) {
|
||||
return
|
||||
}
|
||||
|
||||
// 视频网站子路由 → videoapp SPA
|
||||
if strings.HasPrefix(path, "/video") {
|
||||
// 视频网站子路由 → videoapp SPA(精确避免匹配 /videoapp/)
|
||||
if path == "/video" || strings.HasPrefix(path, "/video/") {
|
||||
serveStaticFile(c, "videoapp/index.html")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"log"
|
||||
)
|
||||
|
||||
//go:embed static/*
|
||||
//go:embed static
|
||||
var embedFS embed.FS
|
||||
|
||||
// StaticFS 嵌入式前端静态文件(根路径已去除 static/ 前缀)
|
||||
|
||||
Reference in New Issue
Block a user