Files
life-echo/app-expo/src/core/config.ts

26 lines
585 B
TypeScript
Raw Normal View History

function trimTrailingSlashes(value: string): string {
return value.replace(/\/+$/, '');
}
export const config = {
apiBaseUrl: trimTrailingSlashes(
process.env.EXPO_PUBLIC_API_URL ?? 'http://192.168.10.151:8000',
),
wsBaseUrl: trimTrailingSlashes(
process.env.EXPO_PUBLIC_WS_URL ?? 'ws://192.168.10.151:8000',
),
isDebugMode: __DEV__,
api: {
timeoutMs: 30_000,
refreshPath: '/api/auth/refresh',
},
ws: {
reconnectMaxRetries: 10,
reconnectBaseDelayMs: 1_000,
reconnectMaxDelayMs: 30_000,
heartbeatIntervalMs: 30_000,
},
} as const;