mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-03-09 08:12:02 +00:00
fix: update healthcheck to use server address and port individually (#698)
This commit is contained in:
committed by
GitHub
parent
d7d540000f
commit
f80be1ca61
@@ -28,15 +28,18 @@ func healthcheckCmd() *cli.Command {
|
||||
Run: func(args []string) error {
|
||||
tlog.NewSimpleLogger().Init()
|
||||
|
||||
appUrl := "http://127.0.0.1:3000"
|
||||
|
||||
srvAddr := os.Getenv("TINYAUTH_SERVER_ADDRESS")
|
||||
srvPort := os.Getenv("TINYAUTH_SERVER_PORT")
|
||||
|
||||
if srvAddr != "" && srvPort != "" {
|
||||
appUrl = fmt.Sprintf("http://%s:%s", srvAddr, srvPort)
|
||||
if srvAddr == "" {
|
||||
srvAddr = "127.0.0.1"
|
||||
}
|
||||
|
||||
srvPort := os.Getenv("TINYAUTH_SERVER_PORT")
|
||||
if srvPort == "" {
|
||||
srvPort = "3000"
|
||||
}
|
||||
|
||||
appUrl := fmt.Sprintf("http://%s:%s", srvAddr, srvPort)
|
||||
|
||||
if len(args) > 0 {
|
||||
appUrl = args[0]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user