text: const {Sequelize} = require('sequelize')
  
  const dotenv = require('dotenv');
  
  //LOCAL CONNECTION
  /* const sequelize = new Sequelize('conduit','root','password',{
      dialect: 'mysql',
      host:'localhost',
      logging: false
  }); */
  
  
  //AMAZON RDS CONNECTION
  /* const sequelize = new Sequelize('conduit1',process.env.USER_NAME,process.env.PASSWORD,{
      dialect: 'mysql',
      host:process.env.DB_HOST,
      logging: false,
      port: 3306
  });
   */
  
  dotenv.config();
  
  const DB_HOST = process.env.DB_HOST;
  const DB_USERNAME = process.env.DB_USERNAME;
  
  const sequelize = new Sequelize('d6rk5ijgmvcf6q',process.env.DB_USERNAME,process.env.DB_PASSWORD,{
      dialect: 'postgres',
      host: process.env.DB_HOST, 
      logging: false,
      port: process.env.PORT,
      
  });
  
  const checkConnection =async () => {
      try {
          await sequelize.authenticate();
          console.log('Connection has been established successfully.');
      } catch (error) {
          console.error('Unable to connect to the database:', error);
      }
  }
  
  checkConnection()
  
  module.exports = sequelize