Skip to content

Commit

Permalink
feat(general): added CLI and bcrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Peshkov committed Jan 29, 2020
1 parent 1607362 commit eb5da5e
Show file tree
Hide file tree
Showing 3 changed files with 337 additions and 5 deletions.
18 changes: 18 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const models = require('./models');
const { Sequelize, sequelize, authenticate } = require('./lib/sequelize');

global.authenticate = authenticate;
global.Sequelize = Sequelize;
global.sequelize = sequelize;

for (const key in models) {
global[key] = models[key]; // importing models as global
}

try {
authenticate();
} catch(err) {
/* eslint-disable-next-line no-console */
console.error('Error connecting to DB:', err.message);
process.quit(1);
}
Loading

0 comments on commit eb5da5e

Please sign in to comment.