mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 21:32:11 +08:00
SetBasePath To modify basePath
This commit is contained in:
parent
b463b1c2a1
commit
f78f06027e
8
gin.go
8
gin.go
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user