Created
September 9, 2016 17:00
-
-
Save mbleigh/da9abda27104810b790b1ea4e8208582 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ENVS = { | |
prod: {firebase: {firebaseURL: 'https://my-app-prod.firebaseio.com'}}, | |
staging: {firebase: {firebaseURL: 'https://my-app-staging.firebaseio.com'}}, | |
dev: {firebase: {firebaseURL: 'https://my-app-dev.firebaseio.com'}}, | |
} | |
window.__env = (function() { | |
switch(window.location.hostname) { | |
case 'localhost': | |
return ENVS.dev; | |
case 'my-app-staging.firebaseapp.com': | |
case 'my-app-staging.com': | |
return ENVS.staging; | |
case 'my-app-prod.firebaseapp.com': | |
case 'my-app.com': | |
return ENVS.prod; | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment