Created
December 20, 2017 18:21
-
-
Save krescruz/9dd2efcfedea084f174b732d6337ac7c to your computer and use it in GitHub Desktop.
Use of conditional variable in development using nodejs
This file contains hidden or 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
/** | |
* Example: Base URL to consume REST API only in development | |
*/ | |
let API_URL = 'https://krescruz.com/api' //URL PRODUCTION | |
if (!process.env.NODE_ENV || process.env.NODE_ENV === 'development') { | |
API_URL = 'http://localhost:8000/api' //URL DEVELOPMENT | |
} | |
export const API_URL_BASE = API_URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment