Update server, embed, gitignore
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
# Binary
|
# Binary
|
||||||
api-server
|
api-server
|
||||||
|
api-server*
|
||||||
|
|
||||||
# Runtime data
|
# Runtime data
|
||||||
data/
|
data/
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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/ 前缀)
|
||||||
|
|||||||
Reference in New Issue
Block a user