'use strict';

var path = require('path'),
    rootPath = path.normalize(__dirname + '/..'),
    env = process.env.NODE_ENV || 'development',
    user = process.env.MONGO_USER_NAME,
    pass = process.env.MONGO_USER_PASS;

var config = {
  development : {
    env   : env,
    root  : rootPath,
    mongo : {},
    app   : {
      name : 'flickr-downloadr-webhook'
    },
    port  : 1337,
    db    : 'mongodb://localhost/flickr-downloadr-webhook-development'
  },
  test        : {
    env   : env,
    root  : rootPath,
    mongo : {},
    app   : {
      name : 'flickr-downloadr-webhook'
    },
    port  : 1337,
    db    : 'mongodb://localhost/flickr-downloadr-webhook-test'
  },
  production  : {
    env   : env,
    root  : rootPath,
    mongo : {},
    app   : {
      name : 'flickr-downloadr-webhook'
    },
    port  : process.env.PORT,
    db    : 'mongodb://' + user + ':' + pass + '@ds119748.mlab.com:19748/fd-webhook'
  }
};

module.exports = config[env];

@@ -213,18 +213,61 @@
 SER_PASS
+,%0A    mongodb_uri = process.env.MONGODB_URI
 ;%0A
-
 %0Avar con
@@ -723,16 +723,274 @@
 t'%0A  %7D,%0A
+  old_production  : %7B%0A    env   : env,%0A    root  : rootPath,%0A    mongo : %7B%7D,%0A    app   : %7B%0A      name : 'flickr-downloadr-webhook'%0A    %7D,%0A    port  : process.env.PORT,%0A    db    : 'mongodb://' + user + ':' + pass + '@ds119748.mlab.com:19748/fd-webhook'%0A  %7D,%0A
   produc
@@ -1161,80 +1161,19 @@
   : 
-'
 mongodb
-://' + user + ':' + pass + '@ds119748.mlab.com:19748/fd-webhook'
+_uri
 %0A  %7D

update the mongodb uri yet another time