Skip to content

Instantly share code, notes, and snippets.

@blogcacanid
Created November 12, 2020 07:44
Show Gist options
  • Save blogcacanid/acf9a1c452e1d06d15c246ecd2427656 to your computer and use it in GitHub Desktop.
Save blogcacanid/acf9a1c452e1d06d15c246ecd2427656 to your computer and use it in GitHub Desktop.
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