Skip to content

Commit

Permalink
Merge pull request #24 from pusher/drop-staging
Browse files Browse the repository at this point in the history
Drop staging from everywhere
  • Loading branch information
jameshfisher authored Dec 12, 2017
2 parents 05f6653 + e96a9fb commit 4d309c5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
11 changes: 9 additions & 2 deletions commands/channels/generate_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
});
Expand Down
18 changes: 16 additions & 2 deletions commands/channels/generate_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
);
Expand Down Expand Up @@ -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())
Expand All @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion commands/channels/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion commands/channels/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4d309c5

Please sign in to comment.