Skip to content

Commit

Permalink
On notification server, get server host and port from environement if…
Browse files Browse the repository at this point in the history
… set (#728)
  • Loading branch information
Josue-T authored Dec 16, 2024
1 parent c11e8cc commit da31024
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion notification-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"os/signal"
"path/filepath"
"strings"
"strconv"
"syscall"
"time"

Expand Down Expand Up @@ -45,8 +46,18 @@ func init() {
}

func loadNotifConfig() {
host = "0.0.0.0"
host := os.Getenv("NOTIFICATION_SERVER_HOST")
if host == "" {
host = "0.0.0.0"
}

port = 8083
if os.Getenv("NOTIFICATION_SERVER_PORT") != "" {
i, err := strconv.Atoi(os.Getenv("NOTIFICATION_SERVER_PORT"))
if err == nil {
port = i
}
}

logLevel := os.Getenv("NOTIFICATION_SERVER_LOG_LEVEL")
if logLevel == "" {
Expand Down

0 comments on commit da31024

Please sign in to comment.