From 97c189b1956760f8142f180d097227a86366025f Mon Sep 17 00:00:00 2001 From: Roman Vynar Date: Mon, 30 Jul 2018 11:22:48 +0300 Subject: [PATCH] Make web root accessible w/o trailing slash when base_path is configured. --- CHANGELOG.md | 4 ++++ main.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c63618a..1d10c27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/main.go b/main.go index 47c0c22..2199f12 100644 --- a/main.go +++ b/main.go @@ -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)