import url from 'url';

export const isApiExternal = !!url.parse(__API_URL__).protocol;
export const apiUrl = !isApiExternal
  ? `${window.location.protocol}//${window.location.hostname}:8080${__API_URL__}`
  : __API_URL__;

import url from 'url';

export const isApiExternal = !!url.parse(__API_URL__).protocol;
export const apiUrl = !isApiExternal
  ? `${window.location.protocol}//${window.location.hostname}${
      __DEV__ ? ':8080' : window.location.port ? ':' + window.location.port : ''
    }${__API_URL__}`
  : __API_URL__;

Fix API URL for production in case when relative URL used
Fix API URL for production in case when relative URL used
