Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
banterglow authored Jan 12, 2018
1 parent 2567281 commit 75246f6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ const pg = require('pg');
const path = require('path');
const moment = require('moment');

const connection = {
host: process.env.DATABASE_URL || 'localhost',
database: 'lawa_db'
};
// ADD PATH TO DATABASE URL ABOVE
const connection = process.env.DATABASE_URL ?
{ connectionString: process.env.DATABASE_URL } :
{ host: 'localhost', database: 'lawa_db' };

const pool = new pg.Pool(connection);
pool.connect();
Expand Down

0 comments on commit 75246f6

Please sign in to comment.