index.ts

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

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

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

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