From 939c733503144abdb44277608f97d05ae7268052 Mon Sep 17 00:00:00 2001 From: "pzrr@qq.com" Date: Fri, 24 Aug 2018 19:55:37 +0800 Subject: [PATCH 1/2] #### Version 1.5.7.3 * New Feature: Add HttpServer.VirtualPath, used to set virtual path when deploy on no root path * Detail: - when set virtual path "/vpath", if set route "/index", it will auto register "vpath/index" - in effect on group & route * 2018-08-24 19:00 --- dotweb.go | 2 +- server.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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..048614c 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 } } From 083fd0a1715efe0d093777efedfa6d5174ec9387 Mon Sep 17 00:00:00 2001 From: "pzrr@qq.com" Date: Fri, 24 Aug 2018 19:57:40 +0800 Subject: [PATCH 2/2] #### Version 1.5.7.3 * New Feature: Add HttpServer.VirtualPath, used to set virtual path when deploy on no root path * Detail: - when set virtual path "/vpath", if set route "/index", it will auto register "vpath/index" - in effect on group & route * 2018-08-24 19:00 --- server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server.go b/server.go index 048614c..e0b2336 100644 --- a/server.go +++ b/server.go @@ -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