mirror of
https://github.com/tinyauthapp/tinyauth.git
synced 2026-08-11 19:43:43 +08:00
fix: update healthcheck to use server address and port individually (#698)
This commit is contained in:
@@ -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