Skip to content

Instantly share code, notes, and snippets.

@blogcacanid

blogcacanid/index.js

Created Nov 12, 2020
Embed
What would you like to do?
index.js Authentication JWT Node.js
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