Created
November 12, 2020 07:44
-
-
Save blogcacanid/acf9a1c452e1d06d15c246ecd2427656 to your computer and use it in GitHub Desktop.
index.js Authentication JWT Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const config = require("../config/db.config.js"); | |
const Sequelize = require("sequelize"); | |
const sequelize = new Sequelize( | |
config.DB, | |
config.USER, | |
config.PASSWORD, | |
{ | |
host: config.HOST, | |
dialect: config.dialect, | |
pool: { | |
max: config.pool.max, | |
min: config.pool.min, | |
acquire: config.pool.acquire, | |
idle: config.pool.idle | |
} | |
} | |
); | |
const db = {}; | |
db.Sequelize = Sequelize; | |
db.sequelize = sequelize; | |
db.user = require("../models/user.model.js")(sequelize, Sequelize); | |
module.exports = db; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment