mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-17 09:59:10 +00:00
16 lines
505 B
TypeScript
16 lines
505 B
TypeScript
import * as memoizeOne from 'memoize-one';
|
|
|
|
export const getDefaultApiUrl = memoizeOne.default((host: string) => {
|
|
if (/^roleypoly\.com$/.test(host)) {
|
|
return 'https://api-prod.roleypoly.com';
|
|
} 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';
|
|
} else {
|
|
return 'https://api-prod.roleypoly.com';
|
|
}
|
|
});
|