From 0c84e42160ce145573fbf6610512a993f6182f58 Mon Sep 17 00:00:00 2001 From: maddalax Date: Mon, 6 Jan 2025 10:26:15 -0600 Subject: [PATCH] add info on how to change it --- framework/h/app.go | 7 +++++++ htmgo-site/main.go | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/h/app.go b/framework/h/app.go index bdeb585..f4143aa 100644 --- a/framework/h/app.go +++ b/framework/h/app.go @@ -230,13 +230,20 @@ func (app *App) start() { } port := ":3000" + isDefaultPort := true if os.Getenv("PORT") != "" { port = fmt.Sprintf(":%s", os.Getenv("PORT")) + isDefaultPort = false } if app.Opts.Port != 0 { port = fmt.Sprintf(":%d", app.Opts.Port) + isDefaultPort = false + } + + if isDefaultPort { + slog.Info("Using default port 3000, set PORT environment variable to change it or use AppOpts.Port") } slog.Info(fmt.Sprintf("Server started at localhost%s", port)) diff --git a/htmgo-site/main.go b/htmgo-site/main.go index 019a1a1..35914f3 100644 --- a/htmgo-site/main.go +++ b/htmgo-site/main.go @@ -23,7 +23,6 @@ func main() { h.Start(h.AppOpts{ ServiceLocator: locator, - Port: 3002, LiveReload: true, Register: func(app *h.App) {