default redirect to true
Alan Pearce alan@alanpearce.eu
Wed, 26 Jun 2024 18:48:18 +0200
2 files changed, 2 insertions(+), 3 deletions(-)
M internal/server/server.go → internal/server/server.go
@@ -33,7 +33,7 @@ type Config struct { Development bool `conf:"default:false,flag:dev"` Root string `conf:"default:website"` - Redirect bool `conf:"default:false"` + Redirect bool `conf:"default:true"` ListenAddress string `conf:"default:localhost"` Port int `conf:"default:3000,short:p"` TLSPort int `conf:"default:443"` @@ -164,7 +164,7 @@ if err != nil { return nil, errors.Wrap(err, "could not create website mux") } - if runtimeConfig.Development || runtimeConfig.Redirect { + if runtimeConfig.Redirect { loggingMux.Handle(config.BaseURL.Hostname()+"/", mux) loggingMux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { newURL := config.BaseURL.JoinPath(r.URL.String())