|
|
|
@ -1,4 +1,6 @@ |
|
|
|
import { ENV } from 'config/env' |
|
|
|
import { ENV, isProduction } from 'config/env' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { readSelectedApi } from 'helpers/selectedApi' |
|
|
|
|
|
|
|
|
|
|
|
const APIS = { |
|
|
|
const APIS = { |
|
|
|
preproduction: 'https://api.auth.insports.tv', |
|
|
|
preproduction: 'https://api.auth.insports.tv', |
|
|
|
@ -6,7 +8,9 @@ const APIS = { |
|
|
|
staging: 'https://api.auth.test.insports.tv', |
|
|
|
staging: 'https://api.auth.test.insports.tv', |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export const API_ROOT = APIS[ENV] |
|
|
|
const env = isProduction ? ENV : readSelectedApi() ?? ENV |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const API_ROOT = APIS[env] |
|
|
|
|
|
|
|
|
|
|
|
export const getApiUrl = (path: string) => ( |
|
|
|
export const getApiUrl = (path: string) => ( |
|
|
|
`${API_ROOT}${path}${window.location.search}` |
|
|
|
`${API_ROOT}${path}${window.location.search}` |
|
|
|
|