Friday 14 April 2017

Can we do profiling in Javascript

I have a JS file contain some configuration code like:

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

The username,password,host,port and name can be change according to enviornment. Like development, QA, production. Every time when I change the environment I need to modify my JS file.Is there any way by which I can keep all the details together and get the values from the respective environment.

Thanks in advance



via Anand Deshmukh

No comments:

Post a Comment