mirror of
https://github.com/openziti/zrok.git
synced 2024-11-28 19:14:07 +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() {
|
func init() {
|
||||||
pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti-test-kitchen/"))
|
pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti-test-kitchen/"))
|
||||||
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Enable verbose logging")
|
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)
|
rootCmd.AddCommand(httpCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user