@@ -447,6 +447,17 @@ You can either specify a new endpoint URL directly or use the service-based endp
447447 }
448448
449449 if urlFlag != "" {
450+ // Check if the URL starts with grpc:// or grpc+ssl://
451+ if strings .HasPrefix (urlFlag , "grpc://" ) || strings .HasPrefix (urlFlag , "grpc+ssl://" ) {
452+ appV .Set (fmt .Sprintf ("environments.%s.endpoint" , currentEnv ), urlFlag )
453+ if err := appV .WriteConfig (); err != nil {
454+ pterm .Error .Printf ("Failed to update setting.yaml: %v\n " , err )
455+ return
456+ }
457+ pterm .Success .Printf ("Updated endpoint for '%s' to '%s'.\n " , currentEnv , urlFlag )
458+ return
459+ }
460+
450461 if strings .HasSuffix (currentEnv , "-app" ) {
451462 pterm .Error .Println ("Direct URL endpoint update is not available for user environment." )
452463 pterm .Info .Println ("Please use the service flag (-s) instead." )
@@ -491,6 +502,12 @@ You can either specify a new endpoint URL directly or use the service-based endp
491502
492503 // If list flag is provided, only show available services
493504 if listFlag {
505+ // Check if environment is local
506+ if currentEnv == "local" {
507+ pterm .Error .Println ("Service listing is not available in local environment." )
508+ return
509+ }
510+
494511 token , err := getToken (appV )
495512 if err != nil {
496513 if strings .HasSuffix (currentEnv , "-user" ) {
@@ -693,7 +710,9 @@ You can either specify a new endpoint URL directly or use the service-based endp
693710 if service != "" {
694711 var endpoints map [string ]string
695712
696- if strings .HasPrefix (endpoint , "http://" ) || strings .HasPrefix (endpoint , "https://" ) {
713+ if strings .HasPrefix (endpoint , "grpc://" ) || strings .HasPrefix (endpoint , "grpc+ssl://" ) {
714+ appV .Set (fmt .Sprintf ("environments.%s.endpoint" , currentEnv ), endpoint )
715+ } else if strings .HasPrefix (endpoint , "http://" ) || strings .HasPrefix (endpoint , "https://" ) {
697716 // HTTP/HTTPS endpoint case
698717 client := & http.Client {}
699718 req , err := http .NewRequest ("POST" , restIdentityEndpoint + "/endpoint/list" , bytes .NewBuffer ([]byte ("{}" )))
0 commit comments