SetBasePath To modify basePath

This commit is contained in:
springrain 2021-08-14 19:37:03 +08:00
parent b463b1c2a1
commit f78f06027e

8
gin.go
View File

@ -318,6 +318,14 @@ func (engine *Engine) Routes() (routes RoutesInfo) {
return routes
}
// SetBasePath To modify basePath
func (engine *Engine) SetBasePath(basePath string) {
if len(basePath) < 1 {
return
}
engine.basePath = basePath
}
func iterate(path, method string, routes RoutesInfo, root *node) RoutesInfo {
path += root.path
if len(root.handlers) > 0 {