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

@ -1,5 +1,9 @@
## Changelog
### 0.7.2 (2018-07-30)
* Make web root accessible w/o trailing slash when base_path is configured.
### 0.7.1 (2018-07-18)
* Fix panic when using MySQL for events storage and no table created yet.

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)