mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
fix(web): getDefaultApiUrl should handle stage.roleypoly.com as stage
This commit is contained in:
parent
cd448b56c9
commit
a87ccd9c54
2 changed files with 6 additions and 2 deletions
|
@ -2,6 +2,7 @@ import { getDefaultApiUrl } from './getDefaultApiUrl';
|
|||
|
||||
it.each([
|
||||
['https://next.roleypoly.com/servers', 'https://api-prod.roleypoly.com'],
|
||||
['https://stage.roleypoly.com/servers', 'https://api-stage.roleypoly.com'],
|
||||
['https://roleypoly.com/servers', 'https://api-prod.roleypoly.com'],
|
||||
['https://notroleypolybutclose.com/servers', 'https://api-prod.roleypoly.com'],
|
||||
['https://myhash.roleypoly.pages.dev/servers', 'https://api-stage.roleypoly.com'],
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
export const getDefaultApiUrl = (host: string = window.location.hostname) => {
|
||||
if (/roleypoly.com$/.test(host)) {
|
||||
if (/^roleypoly.com$/.test(host)) {
|
||||
return 'https://api-prod.roleypoly.com';
|
||||
} else if (/roleypoly\.pages\.dev$/.test(host)) {
|
||||
} else if (
|
||||
/roleypoly\.pages\.dev$/.test(host) ||
|
||||
/^stage.roleypoly.com$/.test(host)
|
||||
) {
|
||||
return 'https://api-stage.roleypoly.com';
|
||||
} else if (/\blocalhost|127\.0\.0\.1\b/.test(host)) {
|
||||
return 'http://localhost:6609';
|
||||
|
|
Loading…
Add table
Reference in a new issue