- Added A TON of stuff, separated everything neatly and cleaned most models
This commit is contained in:
23
database/bookshelf.js
Normal file
23
database/bookshelf.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// MODULES
|
||||
const fs = require('fs')
|
||||
const mysql = require('mysql')
|
||||
|
||||
// Fetches and parses credentials file
|
||||
let credentials_data = fs.readFileSync('./database/credentials.json')
|
||||
let credentials = JSON.parse(credentials_data)
|
||||
|
||||
// Setting up the database connection
|
||||
const knex = require('knex')({
|
||||
client: credentials.client,
|
||||
connection: {
|
||||
host : credentials.host,
|
||||
user : credentials.user,
|
||||
password : credentials.password,
|
||||
database : credentials.database,
|
||||
charset : credentials.charset
|
||||
},
|
||||
debug: true
|
||||
})
|
||||
const bookshelf = require('bookshelf')(knex)
|
||||
|
||||
module.exports = { bookshelf }
|
||||
Reference in New Issue
Block a user