The goal here is to keep the same structure than the other examples. Also, considering that it has a "frontend" folder, the equivalent for the server should be "backend". Signed-off-by: Jérémie Drouet <jeremie.drouet@gmail.com>
		
			
				
	
	
		
			13 lines
		
	
	
		
			299 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			299 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| var env = process.env.NODE_ENV || 'development';
 | |
| 
 | |
| if(env === 'development' || env === 'test'){
 | |
| 
 | |
|     const config = require('./config.json')
 | |
|     let envConfig = config[env];
 | |
|     console.log(envConfig);
 | |
| 
 | |
|     Object.keys(envConfig).forEach((key) => {
 | |
|         process.env[key] = envConfig[key]
 | |
|     })
 | |
| }
 |