From 15cca2edf32fa7ecce4da40281f1fffe59beb147 Mon Sep 17 00:00:00 2001 From: jano3 <jano@bob.co.za> Date: Mon, 31 Mar 2025 08:49:41 +0200 Subject: [PATCH] Update URL for websocket API --- websocket_utils/websocket_utils.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/websocket_utils/websocket_utils.go b/websocket_utils/websocket_utils.go index 029bff6..921e7e1 100644 --- a/websocket_utils/websocket_utils.go +++ b/websocket_utils/websocket_utils.go @@ -26,8 +26,6 @@ func GetClient(region ...string) *APIGateWayClientWithHelpers { logs.ErrorMsg("WEBSOCKET_DOMAIN_NAME env variable is not set") return &APIGateWayClientWithHelpers{} } - - env := utils.GetEnv("ENVIRONMENT", "dev") s3Region := os.Getenv("AWS_REGION") // Set custom region @@ -49,15 +47,15 @@ func GetClient(region ...string) *APIGateWayClientWithHelpers { return &APIGateWayClientWithHelpers{} } - apiGatewaySession := NewClient(cfg, domainName, env) + apiGatewaySession := NewClient(cfg, domainName) sessions[s3Region] = apiGatewaySession return apiGatewaySession } -func NewClient(config aws.Config, domainName string, env string) *APIGateWayClientWithHelpers { +func NewClient(config aws.Config, domainName string) *APIGateWayClientWithHelpers { return &APIGateWayClientWithHelpers{ 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, } -- GitLab