fixed urlprefix when == "/"
This commit is contained in:
parent
00cd7de6df
commit
6a5a72abae
1 changed files with 3 additions and 1 deletions
2
main.go
2
main.go
|
@ -175,7 +175,9 @@ func (web *Web) initRouter() {
|
|||
|
||||
if viper.IsSet("gin.urlprefix") {
|
||||
urlPrefix := viper.GetString("gin.urlprefix")
|
||||
if urlPrefix != "/" {
|
||||
urlPrefix = path.Join("/", urlPrefix) + "/"
|
||||
}
|
||||
web.urlPrefix = urlPrefix
|
||||
log.Println("Running under path: " + web.urlPrefix)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue