diff options
author | Alan Pearce | 2024-06-26 18:48:18 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-26 18:48:18 +0200 |
commit | 75ec9482b7bde65e9569fdbf50d934c1d60ad55a (patch) | |
tree | 0daa8b369d9f6801071279425db14e8bd12bbd7c /internal/server | |
parent | d6253aca4b4a00b4bcd2adb4004a63f56a692f74 (diff) | |
download | website-75ec9482b7bde65e9569fdbf50d934c1d60ad55a.tar.lz website-75ec9482b7bde65e9569fdbf50d934c1d60ad55a.tar.zst website-75ec9482b7bde65e9569fdbf50d934c1d60ad55a.zip |
default redirect to true
Diffstat (limited to 'internal/server')
-rw-r--r-- | internal/server/server.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/server/server.go b/internal/server/server.go index 9781364..3110ec0 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -33,7 +33,7 @@ var ( 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 @@ func New(runtimeConfig *Config) (*Server, error) { 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()) |