Created
          June 28, 2017 15:37 
        
      - 
      
- 
        Save jbgutierrez/3ad096c9169089007ec823e7cb5c6df4 to your computer and use it in GitHub Desktop. 
    Gestión de la configuración
  
        
  
    
      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
    
  
  
    
  | const config = require('./config'); | |
| console.log(config); | 
  
    
      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
    
  
  
    
  | const config = require('./config.json'); | |
| Object.assign(module.exports, config.defaults, config[process.env.NODE_ENV]) | 
  
    
      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
    
  
  
    
  | { | |
| "defaults": { | |
| "hello": "world", | |
| "foo": "bar" | |
| }, | |
| "local": { | |
| "foo": "bar local" | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment