Fixed base path (again again again) and rewrote .env

This commit is contained in:
2022-02-02 10:28:26 +01:00
parent 83931bd2a4
commit a189b7a378
9 changed files with 19 additions and 35 deletions

View File

@@ -17,8 +17,8 @@ func main() {
r.StrictSlash(true)
var subrouter *mux.Router
if config.Prefix != "" {
subrouter = r.PathPrefix(config.Prefix).Subrouter()
if config.Path != "/" {
subrouter = r.PathPrefix(config.Path).Subrouter()
} else {
subrouter = r
}
@@ -69,7 +69,7 @@ func setupFrontend(r *mux.Router) {
r.Path("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
landingpage.Execute(w, struct {
BasePath string
}{BasePath: config.BasePath})
}{BasePath: config.Address + config.Path})
})
r.NotFoundHandler = http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {