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 || ''
    }${__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}:8080${__API_URL__}`
  : __API_URL__;

Fix production URL to GraphQL API is relative URL used
Fix production URL to GraphQL API is relative URL used
