diff --git a/dotweb.go b/dotweb.go index 4986667..2db4094 100644 --- a/dotweb.go +++ b/dotweb.go @@ -503,7 +503,7 @@ func (app *DotWeb) initBindMiddleware() { // IncludeDotwebGroup init inner routers func (app *DotWeb) IncludeDotwebGroup() { //默认支持pprof信息查看 - gInner := app.HttpServer.Group(app.HttpServer.VirtualPath() + "/dotweb") + gInner := app.HttpServer.Group("/dotweb") gInner.GET("/debug/pprof/:key", initPProf) gInner.GET("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/debug/freemem", freeMemory) gInner.GET("/state", showServerState) diff --git a/server.go b/server.go index 0d51074..e0b2336 100644 --- a/server.go +++ b/server.go @@ -87,7 +87,7 @@ func (server *HttpServer) initConfig(){ server.SetEnabledGzip(server.ServerConfig().EnabledGzip) //VirtualPath config - if server.virtualPath != ""{ + if server.virtualPath == ""{ server.virtualPath = server.ServerConfig().VirtualPath } } @@ -206,6 +206,8 @@ func (server *HttpServer) IsOffline() bool { // SetVirtualPath set current server's VirtualPath func (server *HttpServer) SetVirtualPath(path string){ server.virtualPath = path + logger.Logger().Debug("DotWeb:HttpServer SetVirtualPath ["+path+"]", LogTarget_HttpServer) + } // VirtualPath return current server's VirtualPath @@ -216,6 +218,8 @@ func (server *HttpServer) VirtualPath() string{ // SetOffline set server offline config func (server *HttpServer) SetOffline(offline bool, offlineText string, offlineUrl string) { server.offline = offline + logger.Logger().Debug("DotWeb:HttpServer SetOffline ["+strconv.FormatBool(offline)+", " + offlineText +", " + offlineUrl + "]", LogTarget_HttpServer) + } // IndexPage default index page name