add info on how to change it

This commit is contained in:
maddalax 2025-01-06 10:26:15 -06:00
parent 4f537567ad
commit 0c84e42160
2 changed files with 7 additions and 1 deletions

View file

@ -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))

View file

@ -23,7 +23,6 @@ func main() {
h.Start(h.AppOpts{
ServiceLocator: locator,
Port: 3002,
LiveReload: true,
Register: func(app *h.App) {