fix: update healthcheck to use server address and port individually (#698)

This commit is contained in:
Luiz Felipe Fontes Botelho
2026-03-08 06:17:55 -03:00
committed by GitHub
parent d7d540000f
commit f80be1ca61

View File

@@ -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]
}