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 | |
parent | d6253aca4b4a00b4bcd2adb4004a63f56a692f74 (diff) | |
download | website-75ec9482b7bde65e9569fdbf50d934c1d60ad55a.tar.lz website-75ec9482b7bde65e9569fdbf50d934c1d60ad55a.tar.zst website-75ec9482b7bde65e9569fdbf50d934c1d60ad55a.zip |
default redirect to true
-rw-r--r-- | fly.toml | 1 | ||||
-rw-r--r-- | internal/server/server.go | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/fly.toml b/fly.toml index 6bc1405..1194b67 100644 --- a/fly.toml +++ b/fly.toml @@ -16,7 +16,6 @@ primary_region = "ams" TLS = "true" ROOT = "/data" PRODUCTION = "true" - REDIRECT = "true" LOCAL_PATH = "/data/website" REMOTE_URL = "https://git.alanpearce.eu/website.git" 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()) |