Skip to content
Snippets Groups Projects
Commit 15cca2ed authored by Jano Hendriks's avatar Jano Hendriks
Browse files

Update URL for websocket API

parent 0da918e6
Branches
Tags v1.286.0
No related merge requests found
...@@ -26,8 +26,6 @@ func GetClient(region ...string) *APIGateWayClientWithHelpers { ...@@ -26,8 +26,6 @@ func GetClient(region ...string) *APIGateWayClientWithHelpers {
logs.ErrorMsg("WEBSOCKET_DOMAIN_NAME env variable is not set") logs.ErrorMsg("WEBSOCKET_DOMAIN_NAME env variable is not set")
return &APIGateWayClientWithHelpers{} return &APIGateWayClientWithHelpers{}
} }
env := utils.GetEnv("ENVIRONMENT", "dev")
s3Region := os.Getenv("AWS_REGION") s3Region := os.Getenv("AWS_REGION")
// Set custom region // Set custom region
...@@ -49,15 +47,15 @@ func GetClient(region ...string) *APIGateWayClientWithHelpers { ...@@ -49,15 +47,15 @@ func GetClient(region ...string) *APIGateWayClientWithHelpers {
return &APIGateWayClientWithHelpers{} return &APIGateWayClientWithHelpers{}
} }
apiGatewaySession := NewClient(cfg, domainName, env) apiGatewaySession := NewClient(cfg, domainName)
sessions[s3Region] = apiGatewaySession sessions[s3Region] = apiGatewaySession
return apiGatewaySession return apiGatewaySession
} }
func NewClient(config aws.Config, domainName string, env string) *APIGateWayClientWithHelpers { func NewClient(config aws.Config, domainName string) *APIGateWayClientWithHelpers {
return &APIGateWayClientWithHelpers{ return &APIGateWayClientWithHelpers{
APIGatewayClient: apigatewaymanagementapi.NewFromConfig(config, func(o *apigatewaymanagementapi.Options) { APIGatewayClient: apigatewaymanagementapi.NewFromConfig(config, func(o *apigatewaymanagementapi.Options) {
o.BaseEndpoint = utils.ValueToPointer(fmt.Sprintf("https://%s/%s", domainName, env)) o.BaseEndpoint = utils.ValueToPointer(fmt.Sprintf("https://%s/default", domainName))
}), }),
Available: true, Available: true,
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment