healthy
ci/woodpecker/push/build Pipeline failed Details

This commit is contained in:
李亮亮 2024-05-11 11:02:12 +08:00
parent 587f049c1c
commit 0f64e03181
1 changed files with 5 additions and 4 deletions

View File

@ -22,6 +22,10 @@ func (c CategoryController) Show(ctx *gin.Context) {
urlPath := "" urlPath := ""
urlPath = ctx.Request.URL.Path urlPath = ctx.Request.URL.Path
//fmt.Println(urlPath) //fmt.Println(urlPath)
if "/healthy" == urlPath {
ctx.Writer.WriteString("ok")
return
}
if strings.HasPrefix(urlPath, "/static") { if strings.HasPrefix(urlPath, "/static") {
if _, err := os.Stat("." + urlPath); err == nil { if _, err := os.Stat("." + urlPath); err == nil {
@ -32,10 +36,7 @@ func (c CategoryController) Show(ctx *gin.Context) {
} }
} }
rootDir := viper.GetString("dir.root") rootDir := viper.GetString("dir.root")
message := template.HTML("") message := template.HTML(viper.GetString("message"))
if "" != viper.GetString("message") {
message = template.HTML(viper.GetString("message"))
}
path := rootDir + urlPath path := rootDir + urlPath
pathInfo, err := os.Stat(path) pathInfo, err := os.Stat(path)
listResult := util.GetFileList(path) listResult := util.GetFileList(path)