import Constants from 'expo-constants';

// In dev, point at the machine running `npx expo start` — hostUri is that
// machine's LAN address, so a phone on the same wifi reaches the local API
// without hardcoding an IP. Run the API there with `npm run dev` in server/.
const devHost = Constants.expoConfig?.hostUri?.split(':')[0] ?? 'localhost';

export default {
  apiEndpoint: __DEV__ ? `http://${devHost}:4000` : 'https://scoring-api.robertbunch.dev',
  // apiEndpoint: 'https://scoring-api.robertbunch.dev', // force production while testing

  // Shared secret matching API_KEY in server/.env. Ships in the app bundle, so
  // it keeps out drive-by traffic, not a determined attacker — fine for a
  // two-person app until real auth lands.
  apiKey: '2b80aa3e16164aae6c605a294aa5f3f9ced1b1080425fc2e',
};
