All files / database/config config.js

100% Statements 3/3
100% Branches 2/2
100% Functions 1/1
100% Lines 3/3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171x             6x         1x        
const LOCALHOST_DB_POSTGRESQL_URL = 'postgres://postgres@localhost:5432/node-friends-app';
 
/**
 * Generates a valid DB connection info object.
 * @return {Object} All info needed to connect Sequalize to DB
 */
function getConfig() {
  return {
    url: process.env.DB_POSTGRESQL_URL || LOCALHOST_DB_POSTGRESQL_URL,
  };
}
 
module.exports = {
  getConfig,
  ...getConfig(),
};