diff --git a/src/chaos-monkey.coffee b/src/chaos-monkey.coffee index 2d31f8986..0c55c5384 100644 --- a/src/chaos-monkey.coffee +++ b/src/chaos-monkey.coffee @@ -7,9 +7,9 @@ class ChaosMonkey errorCode ?= 500 numMonkeys ?= "all the monkeys" makeTimeout ?= false - nGet = nock(NylasAPI.LocalSyncRoot) - nPut = nock(NylasAPI.LocalSyncRoot) - nPost = nock(NylasAPI.LocalSyncRoot) + nGet = nock(NylasAPI.APIRoot) + nPut = nock(NylasAPI.APIRoot) + nPost = nock(NylasAPI.APIRoot) numTimes = 1 if numMonkeys.toLowerCase() is "all the monkeys" diff --git a/src/flux/nylas-api-request.es6 b/src/flux/nylas-api-request.es6 index aab084b06..862e39e0f 100644 --- a/src/flux/nylas-api-request.es6 +++ b/src/flux/nylas-api-request.es6 @@ -12,7 +12,7 @@ import NylasAPI from './nylas-api' export default class NylasAPIRequest { constructor(api, options) { const defaults = { - url: `${options.APIRoot || options.LocalSyncRoot || api.APIRoot || api.LocalSyncRoot}${options.path}`, + url: `${options.APIRoot || api.APIRoot}${options.path}`, method: 'GET', json: true, timeout: 15000, diff --git a/src/flux/nylas-api.coffee b/src/flux/nylas-api.coffee index 8122559c1..39026c18d 100644 --- a/src/flux/nylas-api.coffee +++ b/src/flux/nylas-api.coffee @@ -56,7 +56,7 @@ class NylasAPI constructor: -> @_lockTracker = new NylasAPIChangeLockTracker() - @LocalSyncRoot = 'http://localhost:2578' + @APIRoot = "http://localhost:2578" # Delegates to node's request object. # On success, it will call the passed in success callback with options. @@ -79,8 +79,6 @@ class NylasAPI return Promise.resolve() NylasAPIRequest ?= require('./nylas-api-request').default - options.APIRoot = @LocalSyncRoot - req = new NylasAPIRequest(@, options) success = (body) => diff --git a/src/flux/nylas-long-connection.es6 b/src/flux/nylas-long-connection.es6 index a7f6ef3d7..e62bd69ac 100644 --- a/src/flux/nylas-long-connection.es6 +++ b/src/flux/nylas-long-connection.es6 @@ -115,11 +115,11 @@ class NylasLongConnection { throw new Error(`Can't establish NylasLongConnection: No account token available for account ${this._accountId}`) } - const options = url.parse(`${this._api.LocalSyncRoot}${this._path}`) + const options = url.parse(`${this._api.APIRoot}${this._path}`) options.auth = `${accountToken}:${identityToken}` let lib; - if (this._api.LocalSyncRoot.indexOf('https') === -1) { + if (this._api.APIRoot.indexOf('https') === -1) { lib = require('http') } else { lib = require('https')