修复路由顺序

This commit is contained in:
NewName
2025-05-17 12:32:51 +08:00
parent 0c27b93326
commit d82b726f04
3 changed files with 15 additions and 4 deletions

View File

@@ -70,12 +70,15 @@ func main() {
loadConfig()
}
}()
// 前端访问路径,默认根路径
router.Static("/", "./public")
router.NoRoute(handler)
// 初始化Skopeo相关路由
// 前端静态文件
router.Static("/", "./public")
// 初始化Skopeo相关路由 - 必须先于NoRoute注册
initSkopeoRoutes(router)
// 注册NoRoute处理器
router.NoRoute(handler)
err := router.Run(fmt.Sprintf("%s:%d", host, port))
if err != nil {