From af8bf62f1636cfa23e36a62685977ca59d872261 Mon Sep 17 00:00:00 2001 From: oers Date: Sun, 6 Mar 2016 12:03:59 +0100 Subject: [PATCH] Fix for mailhog/Mailog#25 provide a ui-web-path config --- config/config.go | 1 - web/web.go | 5 ----- 2 files changed, 6 deletions(-) diff --git a/config/config.go b/config/config.go index f597067..9e0b2fe 100644 --- a/config/config.go +++ b/config/config.go @@ -29,5 +29,4 @@ func Configure() *Config { func RegisterFlags() { flag.StringVar(&cfg.APIHost, "api-host", envconf.FromEnvP("MH_API_HOST", "").(string), "API URL for MailHog UI to connect to, e.g. http://some.host:1234") flag.StringVar(&cfg.UIBindAddr, "ui-bind-addr", envconf.FromEnvP("MH_UI_BIND_ADDR", "0.0.0.0:8025").(string), "HTTP bind interface and port for UI, e.g. 0.0.0.0:8025 or just :8025") - flag.StringVar(&cfg.WebPath, "ui-web-path", envconf.FromEnvP("MH_UI_WEB_PATH", "").(string), "WebPath under which the ui is served (without leading or trailing slahes), e.g. /mailhog defaults to ''") } diff --git a/web/web.go b/web/web.go index fe5f7f6..ea15083 100644 --- a/web/web.go +++ b/web/web.go @@ -29,11 +29,6 @@ func CreateWeb(cfg *config.Config, pat *pat.Router, asset func(string) ([]byte, WebPath = cfg.WebPath - //add a leading slash - if WebPath != "" && !(WebPath[0] == '/') { - WebPath = "/" + WebPath - } - log.Printf("Serving under http://%s%s/", cfg.UIBindAddr, WebPath) pat.Path(WebPath + "/images/{file:.*}").Methods("GET").HandlerFunc(web.Static("assets/images/{{file}}"))