diff options
Diffstat (limited to 'routes')
-rw-r--r-- | routes/index.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/routes/index.js b/routes/index.js index 30f0f9b..24ddf9f 100644 --- a/routes/index.js +++ b/routes/index.js @@ -4,6 +4,12 @@ var collection_json = require('collection_json') , EmployeeDao = require('../lib/dao.js') , _ = require('underscore'); +var database_url; + +module.exports.setup = function(options) { + database_url = options.database_url; +} + function mapRow(row) { var data = _.map(row, function(value, key) { return {name: key, value: value}; @@ -50,7 +56,7 @@ function pager(req) { } function connect(res, cb) { - pg.connect(process.env.DATABASE_URL, function(err, client) { + pg.connect(database_url, function(err, client) { if(err) { res.send('Unable to connect to PostgreSQL.', {'Content-Type': 'text/plain'}, 500); } |