mirror of
https://github.com/openziti/zrok.git
synced 2024-11-25 01:23:49 +01:00
defer to env for ZROK_API_ENDPOINT default (#47)
This commit is contained in:
parent
2042140a4b
commit
0f9360f924
@ -16,7 +16,11 @@ import (
|
||||
func init() {
|
||||
pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti-test-kitchen/"))
|
||||
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Enable verbose logging")
|
||||
rootCmd.PersistentFlags().StringVarP(&apiEndpoint, "endpoint", "e", "api.zrok.io", "zrok API endpoint address")
|
||||
apiEndpointDefault := os.Getenv("ZROK_API_ENDPOINT")
|
||||
if apiEndpoint == "" {
|
||||
apiEndpoint = "api.zrok.io"
|
||||
}
|
||||
rootCmd.PersistentFlags().StringVarP(&apiEndpoint, "endpoint", "e", apiEndpointDefault, "zrok API endpoint address")
|
||||
rootCmd.AddCommand(httpCmd)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user