Fixed base path (again)

This commit is contained in:
2022-02-02 10:10:47 +01:00
parent cac2111296
commit cfe33f517b
4 changed files with 6 additions and 12 deletions

View File

@@ -67,13 +67,9 @@ func setupFrontend(r *mux.Router) {
landingpage := template.Must(template.ParseFiles(filepath.Join(config.FrontendDir, "html", "landingpage.gohtml")))
r.Path("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
basePath := r.URL.Scheme + "://" + config.BasePath
if r.URL.Scheme == "" {
basePath = "http" + basePath
}
landingpage.Execute(w, struct {
BasePath string
}{BasePath: basePath})
}{BasePath: config.BasePath})
})
r.NotFoundHandler = http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {