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

php - Displaying JSON data posts for blog using just the post id -

google bigquery - Delta between query execution time and Java query call to finish -

node.js - How to check multiple conditions to be true or false using protractor ,so that it helps in validating input before click -