Updated model index
This commit is contained in:
parent
77979d8fac
commit
aed75b9576
1 changed files with 7 additions and 12 deletions
|
@ -3,22 +3,17 @@ const path = require("path");
|
|||
const Sequelize = require("sequelize");
|
||||
|
||||
const basename = path.basename(__filename);
|
||||
const env = process.env.NODE_ENV || "development";
|
||||
const env = process.env.NODE_ENV;
|
||||
// eslint-disable-next-line import/no-dynamic-require
|
||||
const config = require(`${__dirname}/../config/config.json`)[env];
|
||||
const db = {};
|
||||
|
||||
let sequelize;
|
||||
if (config.use_env_variable) {
|
||||
sequelize = new Sequelize(process.env[config.use_env_variable], config);
|
||||
} else {
|
||||
sequelize = new Sequelize(
|
||||
const sequelize = new Sequelize(
|
||||
config.database,
|
||||
config.username,
|
||||
config.password,
|
||||
config
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
fs.readdirSync(__dirname)
|
||||
.filter(file => {
|
||||
|
|
Loading…
Reference in a new issue