cli flag for auth rpc host

This commit is contained in:
Quaternions 2024-12-09 19:26:59 -08:00
parent 8c3e9cf9ea
commit fb6b0ad7c7

View File

@ -60,6 +60,12 @@ func NewServeCommand() *cli.Command {
Value: 8080, Value: 8080,
EnvVars: []string{"PORT"}, EnvVars: []string{"PORT"},
}, },
&cli.StringFlag{
Name: "auth-rpc-host",
Usage: "Host of auth rpc",
EnvVars: []string{"AUTH_RPC_HOST"},
Value: "auth-service:8090",
},
}, },
} }
} }
@ -73,7 +79,7 @@ func serve(ctx *cli.Context) error {
DB: db, DB: db,
} }
conn, err := grpc.Dial("auth-service:8090", grpc.WithTransportCredentials(insecure.NewCredentials())) conn, err := grpc.Dial(ctx.String("auth-rpc-host"), grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }