File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ const (
92
92
RegistryService = "registry.api"
93
93
// GraphService is the graph service endpoint
94
94
GraphService = "graph.api"
95
+ // WebhookService is the webhook service endpoint
96
+ WebhookService = "webhook.api"
95
97
)
96
98
97
99
// BackendURL return the base url to the API server
@@ -112,6 +114,8 @@ func BackendURL(subdomain string, channel string) string {
112
114
return os .Getenv ("PP_REGISTRY_SERVICE" )
113
115
case GraphService :
114
116
return os .Getenv ("PP_GRAPHQL_SERVICE" )
117
+ case WebhookService :
118
+ return os .Getenv ("PP_WEBHOOK_SERVICE" )
115
119
}
116
120
case "stable" , "" :
117
121
return fmt .Sprintf ("https://%s.%s" , subdomain , baseURL )
@@ -129,6 +133,8 @@ func BackendURL(subdomain string, channel string) string {
129
133
return fmt .Sprintf ("https://%s.%s:8444/" , subdomain , devbaseURL )
130
134
case GraphService :
131
135
return fmt .Sprintf ("https://%s.%s:3010/" , subdomain , devbaseURL )
136
+ case WebhookService :
137
+ return fmt .Sprintf ("https://%s.%s:8454/" , subdomain , devbaseURL )
132
138
}
133
139
}
134
140
return fmt .Sprintf ("https://%s.%s.%s" , subdomain , channel , baseURL )
Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ func TestBackendURL(t *testing.T) {
22
22
assert .Equal ("https://auth.api.pinpoint.com/" , BackendURL (AuthService , "stable" ))
23
23
assert .Equal ("https://app.pinpoint.com/" , BackendURL (AppService , "stable" ))
24
24
assert .Equal ("https://app.edge.pinpoint.com/" , BackendURL (AppService , "edge" ))
25
+ assert .Equal ("https://webhook.api.edge.pinpoint.com/" , BackendURL (WebhookService , "edge" ))
26
+ assert .Equal ("https://webhook.api.pinpoint.com/" , BackendURL (WebhookService , "stable" ))
27
+ assert .Equal ("https://webhook.api.ppoint.io:8454/" , BackendURL (WebhookService , "dev" ))
25
28
}
26
29
27
30
func TestSetHeaders (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments