Skip to content

Commit

Permalink
Fix for mailhog/Mailog#25 provide a ui-web-path config
Browse files Browse the repository at this point in the history
  • Loading branch information
oers committed Mar 6, 2016
1 parent 9c9aee4 commit af8bf62
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''")
}
5 changes: 0 additions & 5 deletions web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"))
Expand Down

0 comments on commit af8bf62

Please sign in to comment.