Make web root accessible w/o trailing slash when base_path is configured.

This commit is contained in:
Roman Vynar
2018-07-30 11:22:48 +03:00
parent 2a0159b73e
commit 97c189b195
2 changed files with 7 additions and 0 deletions

View File

@@ -124,6 +124,9 @@ func main() {
// Web routes.
e.Static(a.config.BasePath+"/static", "static")
if a.config.BasePath != "" {
e.GET(a.config.BasePath, a.viewRepositories)
}
e.GET(a.config.BasePath+"/", a.viewRepositories)
e.GET(a.config.BasePath+"/:namespace", a.viewRepositories)
e.GET(a.config.BasePath+"/:namespace/:repo", a.viewTags)