26 lines
664 B
TypeScript
26 lines
664 B
TypeScript
|
|
const DEV_API_URL = 'http://127.0.0.1:8000';
|
||
|
|
const DEV_WS_URL = 'ws://127.0.0.1:8000';
|
||
|
|
|
||
|
|
const PROD_API_URL = 'https://lifecho.worldsplats.com';
|
||
|
|
const PROD_WS_URL = 'wss://lifecho.worldsplats.com';
|
||
|
|
|
||
|
|
const useProdServer = process.env.EXPO_PUBLIC_USE_PROD_SERVER === 'true';
|
||
|
|
|
||
|
|
export const config = {
|
||
|
|
apiBaseUrl: useProdServer ? PROD_API_URL : DEV_API_URL,
|
||
|
|
wsBaseUrl: useProdServer ? PROD_WS_URL : DEV_WS_URL,
|
||
|
|
isDebugMode: __DEV__,
|
||
|
|
|
||
|
|
api: {
|
||
|
|
timeoutMs: 30_000,
|
||
|
|
refreshPath: '/api/auth/refresh',
|
||
|
|
},
|
||
|
|
|
||
|
|
ws: {
|
||
|
|
reconnectMaxRetries: 10,
|
||
|
|
reconnectBaseDelayMs: 1_000,
|
||
|
|
reconnectMaxDelayMs: 30_000,
|
||
|
|
heartbeatIntervalMs: 30_000,
|
||
|
|
},
|
||
|
|
} as const;
|