Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dotweb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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("/debug/freemem", freeMemory)
gInner.GET("/state", showServerState)
Expand Down
6 changes: 5 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down