node.js - Can we do profiling in Javascript -


i have js file contain configuration code like:

module.exports = {         database: {             username: 'devusername',             password: 'devpassword',             host: 'xx.xx.xx.xx',             port: 27017,             name: 'admin'                    } }; 

the username,password,host,port , name can change according enviornment. development, qa, production. every time when change environment need modify js file.is there way can keep details , values respective environment.

thanks in advance

you can set these settings using environment variables grab them via process.env. way, long environment variables named same, it's matter of having environment provisioning setup provide them.


Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -