-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: set project endpoint based on the region #1508
base: main
Are you sure you want to change the base?
Conversation
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2024-12-10 01:05:57 CET |
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2024-12-10 01:05:56 CET |
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2024-12-10 01:05:52 CET |
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2024-12-10 01:06:17 CET |
src/lib/constants.ts
Outdated
export const REGION_FRA = 'fra'; | ||
export const REGION_SYD = 'syd'; | ||
export const REGION_NYC = 'nyc'; | ||
|
||
export const SUBDOMAIN_FRA = 'fra.'; | ||
export const SUBDOMAIN_SYD = 'syd.'; | ||
export const SUBDOMAIN_NYC = 'nyc.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think we need constants for that, its good enough to have them locally in the sdk.ts
const getSubdomain = (region?: string) => { | ||
switch (region) { | ||
case REGION_FRA: | ||
return SUBDOMAIN_FRA; | ||
case REGION_SYD: | ||
return SUBDOMAIN_SYD; | ||
case REGION_NYC: | ||
return SUBDOMAIN_NYC; | ||
default: | ||
return ''; | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const getSubdomain = (region?: string) => { | |
switch (region) { | |
case REGION_FRA: | |
return SUBDOMAIN_FRA; | |
case REGION_SYD: | |
return SUBDOMAIN_SYD; | |
case REGION_NYC: | |
return SUBDOMAIN_NYC; | |
default: | |
return ''; | |
} | |
}; | |
const getSubdomain = (region?: string) => { | |
return region ? `${region}.` : ''; | |
}; |
we should probably avoid hardcoding regions for this in the console.
…support-multi-region
…support-multi-region
What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)