diff --git a/models/db_connection.js b/models/db_connection.js new file mode 100644 index 0000000..4ff020d --- /dev/null +++ b/models/db_connection.js @@ -0,0 +1,7 @@ +var Sequelize = require('sequelize'); //require sequelize package + +var DB_URL = process.env.DATABASE_URL || 'postgres://matthuntington@localhost:5432/runs'; //use either environment variable or static url + +var db = new Sequelize(DB_URL); //create the connection. Will not run multiple times, due to require cacheing the file + +module.exports = db;