diff --git a/internal/config/config.go b/internal/config/config.go index b0724a9..ff52f65 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -7,6 +7,7 @@ import ( type Config struct { DB_URL string `json:"db_url"` + LISTEN_ON string `json:"listen_on"` TRUSTED_PROXIES []string `json:"trusted_proxies"` OTLP_ENDPOINT string `json:"otlp_endpoint"` } diff --git a/main.go b/main.go index eb880b1..3623612 100644 --- a/main.go +++ b/main.go @@ -74,12 +74,12 @@ func main() { // Use h2c so we can serve HTTP/2 without TLS. p.SetUnencryptedHTTP2(true) s := http.Server{ - Addr: ":3001", + Addr: conf.LISTEN_ON, Handler: instrumentedHandler, Protocols: p, } - slog.Info("Starting server on :3001") + slog.Info("Starting server on " + conf.LISTEN_ON) if err := s.ListenAndServe(); err != nil { slog.Error("Server failed", slog.String("err", err.Error())) }