function makeClient() {
  const transport = new Thrift.Transport('/api');
  const protocol = new Thrift.Protocol(transport);
  return new ReadOnlySchedulerClient(protocol);
}

export default makeClient();

import { isNully } from 'utils/Common';

function getBaseUrl() {
  // Power feature: load a different Scheduler URL from local storage to test against live APIs.
  //
  // In your browser console:
  //    window.localStorage.apiUrl = 'http://myauroracluster.com';
  //
  // To remove the item:
  //    window.localStorage.removeItem('apiUrl')
  if (window && window.localStorage) {
    return isNully(window.localStorage.apiUrl) ? '' : window.localStorage.apiUrl;
  }
  return '';
}

function makeClient() {
  const transport = new Thrift.Transport(`${getBaseUrl()}/api`);
  const protocol = new Thrift.Protocol(transport);
  return new ReadOnlySchedulerClient(protocol);
}

export default makeClient();

Add support for controlling API url in UI without modifying code.
Add support for controlling API url in UI without modifying code.

Reviewed at https://reviews.apache.org/r/63040/
