'use strict';

console.log("trying to connect to db in environment", process.env.NODE_ENV)
const env = process.env.NODE_ENV || 'development';
const knexConfig = require('../knexfile')[env];
const knex = require('knex')(knexConfig);
const bookshelf = require('bookshelf')(knex);

// added based on tutorial, for exports like module.exports = db.model('User', User);
// supposed to help with more complex relationships
// This plugin allows you to specify relations between models using a string instead of passing variables.
bookshelf.plugin('registry'); // Resolve circular dependencies with relations

module.exports = bookshelf;

@@ -8,16 +8,44 @@
 rict';%0A%0A
+require('dotenv').config()%0A%0A
 console.

add console logging around node_env