From e96a9fb90c65e369bd07cbd044fe15aaeb1cbab3 Mon Sep 17 00:00:00 2001 From: Luis Fonseca Date: Tue, 12 Dec 2017 18:22:54 +0000 Subject: [PATCH] Drop staging from everywhere --- commands/channels/generate_client.go | 11 +++++++++-- commands/channels/generate_server.go | 18 ++++++++++++++++-- commands/channels/subscribe.go | 2 +- commands/channels/trigger.go | 2 +- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/commands/channels/generate_client.go b/commands/channels/generate_client.go index b4840ce..1a3c08c 100644 --- a/commands/channels/generate_client.go +++ b/commands/channels/generate_client.go @@ -29,6 +29,13 @@ var GenerateWeb = &cobra.Command{ return } + app, err := api.GetApp(commands.AppID) + if err != nil { + fmt.Fprintf(os.Stderr, "Could not get app the app: %s\n", err.Error()) + os.Exit(1) + return + } + token, err := api.GetToken(commands.AppID) if err != nil { fmt.Fprintf(os.Stderr, "Could not get app token: %s\n", err.Error()) @@ -45,8 +52,8 @@ var GenerateWeb = &cobra.Command{ Pusher.logToConsole = true; var pusher = new Pusher('` + token.Key + `', { - wsHost: 'ws-test1.staging.pusher.com', - httpHost: 'sockjs-test1.staging.pusher.com', + wsHost: 'ws-` + app.Cluster + `.pusher.com', + httpHost: 'sockjs-` + app.Cluster + `.pusher.com', encrypted: true }); diff --git a/commands/channels/generate_server.go b/commands/channels/generate_server.go index 1ed1046..8142a9a 100644 --- a/commands/channels/generate_server.go +++ b/commands/channels/generate_server.go @@ -29,6 +29,13 @@ var GeneratePhp = &cobra.Command{ return } + app, err := api.GetApp(commands.AppID) + if err != nil { + fmt.Fprintf(os.Stderr, "Could not get app the app: %s\n", err.Error()) + os.Exit(1) + return + } + token, err := api.GetToken(commands.AppID) if err != nil { fmt.Fprintf(os.Stderr, "Could not get app token: %s\n", err.Error()) @@ -40,7 +47,7 @@ var GeneratePhp = &cobra.Command{ require __DIR__ . '/vendor/autoload.php'; $options = array( - 'host' => 'api-test1.staging.pusher.com', + 'host' => 'api-` + app.Cluster + `.pusher.com', 'encrypted' => true ); @@ -71,6 +78,13 @@ var GeneratePython = &cobra.Command{ return } + app, err := api.GetApp(commands.AppID) + if err != nil { + fmt.Fprintf(os.Stderr, "Could not get app the app: %s\n", err.Error()) + os.Exit(1) + return + } + token, err := api.GetToken(commands.AppID) if err != nil { fmt.Fprintf(os.Stderr, "Could not get app token: %s\n", err.Error()) @@ -82,7 +96,7 @@ var GeneratePython = &cobra.Command{ pusher_client = pusher.Pusher(app_id='` + commands.AppID + `', key='` + token.Key + `', secret='` + token.Secret + `', - host='api-test1.staging.pusher.com', + host='api-` + app.Cluster + `.pusher.com', ssl=True ) diff --git a/commands/channels/subscribe.go b/commands/channels/subscribe.go index 03567b0..eedc77e 100644 --- a/commands/channels/subscribe.go +++ b/commands/channels/subscribe.go @@ -47,7 +47,7 @@ var Subscribe = &cobra.Command{ pusher.New(token.Key) client := pusher.NewWithConfig(pusher.ClientConfig{ Scheme: "wss", - Host: "ws-" + app.Cluster + ".staging.pusher.com", + Host: "ws-" + app.Cluster + ".pusher.com", Port: "443", Key: token.Key, Secret: token.Secret, diff --git a/commands/channels/trigger.go b/commands/channels/trigger.go index eb17859..4673728 100644 --- a/commands/channels/trigger.go +++ b/commands/channels/trigger.go @@ -59,7 +59,7 @@ var Trigger = &cobra.Command{ AppId: commands.AppID, Key: token.Key, Secret: token.Secret, - Cluster: app.Cluster + ".staging", // app.Cluster, + Cluster: app.Cluster, } _, err = client.Trigger(commands.ChannelName, commands.EventName, commands.Message)