From c2a0df174f704557f4ea81d9d6dd26eb9343a59c Mon Sep 17 00:00:00 2001 From: Christine Spang Date: Sat, 11 Mar 2017 17:47:37 -0800 Subject: [PATCH] [dev] Default billing server URL to staging for development, allow override Summary: By default, the 'local'/'development' environment assumes that all services are running locally. This makes sense. However, if you're not making changes to auxiliary services such as billing.nylas.com and hence do not have them running locally, firing up Nylas Mail with the 'local' env will not work. It's a bit of a pain to get a local billing service running locally, especially if you're not making any changes to that service. To ease development, change the default billing URL during development to staging, and allow manually overriding the billing server URL to point to localhost in the case that you're making changes to the billing service also. To override the billing URL for local development, run like this: npm run cloud -- --env billing_local BILLING_URL=http://billing.lvh.me:5555 npm start This is both a problem that I've run into during development as well as (my hunch) why Karim accidentally landed a global override of the billing server URL. Test Plan: manual Reviewers: evan, khamidou, halla, juan Reviewed By: juan Differential Revision: https://phab.nylas.com/D4202 --- packages/client-app/src/flux/stores/identity-store.es6 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/client-app/src/flux/stores/identity-store.es6 b/packages/client-app/src/flux/stores/identity-store.es6 index 232b1437a..111b4d639 100644 --- a/packages/client-app/src/flux/stores/identity-store.es6 +++ b/packages/client-app/src/flux/stores/identity-store.es6 @@ -120,7 +120,11 @@ class IdentityStore extends NylasStore { _onEnvChanged = () => { const env = NylasEnv.config.get('env') if (['development', 'local'].includes(env)) { - this.URLRoot = "http://billing.lvh.me:5555"; + if (process.env.BILLING_URL) { + this.URLRoot = process.env.BILLING_URL; + } else { + this.URLRoot = "https://billing-staging.nylas.com"; + } } else if (env === 'experimental') { this.URLRoot = "https://billing-experimental.nylas.com"; } else if (env === 'staging') {