Fixed base path (again)
This commit is contained in:
6
main.go
6
main.go
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user