diff --git a/Config.go b/Config.go index bf43218..a9701d5 100644 --- a/Config.go +++ b/Config.go @@ -12,6 +12,8 @@ type Config struct { BindTo string `json:"bind_to"` Extern string `json:"extern"` Title string `json:"title"` + + ExternalWebroot bool `json:"external_webroot,omitempty"` } Hub struct { diff --git a/main.go b/main.go index 0d7a37a..e7a1dea 100644 --- a/main.go +++ b/main.go @@ -229,7 +229,11 @@ func (this *App) RunServer() { http.HandleFunc("/conf", this.ConfigRequestHandler) // Other files: asset handler - http.HandleFunc("/", this.StaticRequestHandler) + if this.cfg.Web.ExternalWebroot { + http.Handle("/", http.FileServer(http.Dir("client"))) + } else { + http.HandleFunc("/", this.StaticRequestHandler) + } // Listen and serve bindAddr := fmt.Sprintf("%s:%d", this.cfg.Web.BindTo, this.cfg.Web.Port)