add info on how to change it
This commit is contained in:
parent
4f537567ad
commit
0c84e42160
2 changed files with 7 additions and 1 deletions
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ func main() {
|
|||
|
||||
h.Start(h.AppOpts{
|
||||
ServiceLocator: locator,
|
||||
Port: 3002,
|
||||
LiveReload: true,
|
||||
Register: func(app *h.App) {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue