One should always use environment variables to differentiate between development and production environments. I keep a config file to define various variables, connection strings etc. If the variables are set in environment I utilize them otherwise I use the default values meant for local usage . For example, a connection URL in config file may be initialized as following :
connection = process.env.connectionString || localConnectionString
In development mode connection will point to localConnectionString while in production mode it'll be initialized with process.env.connectionString. In fact if you use PaaS solutions like OpenShift, Heroku etc you are expected to follow these standards.