index.js

import {
  DOMAIN_LOCAL,
  FIREBASE_FN_REGION,
  FIREBASE_SUBDOMAIN_PROD
} from '../constants/app';

const dev = {
  API_BACKEND: `${DOMAIN_LOCAL}/${FIREBASE_SUBDOMAIN_PROD}/${FIREBASE_FN_REGION}/api`
};

const prod = {
  API_BACKEND: `https://${FIREBASE_FN_REGION}-${FIREBASE_SUBDOMAIN_PROD}.cloudfunctions.net/api`
};

export const config = ['development'].includes(process.env.NODE_ENV)
  ? dev
  : prod;