support static files
This commit is contained in:
parent
3f0dfd63d4
commit
bb64a2f1ec
|
@ -8,7 +8,6 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gin-contrib/static"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/didi/nightingale/v4/src/common/address"
|
||||
|
@ -42,8 +41,6 @@ func Start() {
|
|||
r.Use(loggerMid)
|
||||
}
|
||||
|
||||
r.Use(static.Serve("/", static.LocalFile("./pub", false)))
|
||||
|
||||
Config(r)
|
||||
|
||||
initStats()
|
||||
|
|
|
@ -10,6 +10,17 @@ import (
|
|||
|
||||
func Config(r *gin.Engine) {
|
||||
r.Static("/pub", "./pub")
|
||||
r.Static("/static", "./pub/static")
|
||||
r.Static("/layout", "./pub/layout")
|
||||
r.Static("/ams/", "./pub/ams")
|
||||
r.Static("/rdb/", "./pub/rdb")
|
||||
r.Static("/job/", "./pub/job")
|
||||
r.Static("/mon/", "./pub/mon")
|
||||
r.StaticFile("/ams", "./pub/layout/index.html")
|
||||
r.StaticFile("/mon", "./pub/layout/index.html")
|
||||
r.StaticFile("/job", "./pub/layout/index.html")
|
||||
r.StaticFile("/rdb", "./pub/layout/index.html")
|
||||
r.StaticFile("/", "./pub/layout/index.html")
|
||||
r.StaticFile("/favicon.ico", "./pub/favicon.ico")
|
||||
|
||||
pprof.Register(r, "/api/server/debug/pprof")
|
||||
|
|
Loading…
Reference in New Issue