daily pastebin goal
43%
SHARE
TWEET

Untitled

a guest Jan 24th, 2019 118 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import dotenv from 'dotenv';
  2. import Sequelize from 'sequelize';
  3.  
  4. const env = dotenv.config();
  5.  
  6. const sequelize = new Sequelize(process.env.DATABASE, process.env.DATABASE_USER, process.env.DATABASE_PASS, {
  7.   host: 'localhost',
  8.   dialect: 'postgres',
  9.   pool: {
  10.     max: 10,
  11.     min: 0,
  12.     acquire: 30000,
  13.     idle: 10000
  14.   }
  15. });
  16.  
  17. const db = {};
  18.  
  19. db.Sequelize = Sequelize;
  20. db.sequelize = sequelize;
  21.  
  22. //Models/tables this needs to be in an es6 format
  23. db.books = require('../model/book.model.js')(sequelize, Sequelize);
  24.  
  25.  
  26. module.exports = db;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top