Skip to content

Commit

Permalink
Use the PORT env variable if present for the default server.
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestoalejo committed Aug 31, 2024
1 parent d657af9 commit 4e60c62
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ func newServerPort(s *Server, opts []Option, internal bool) *ServerPort {
},
port: "8080",
}
if p := os.Getenv("PORT"); p != "" {
sp.port = p
}
if internal {
sp.port = "8000"
}
Expand Down

0 comments on commit 4e60c62

Please sign in to comment.