const { Sequelize } = require("sequelize");
const fs = require('fs');
const sequelize = new Sequelize("madalasa_gurukool_backend", "madalasa_root", "Gurukool@123", {
  host: "localhost",
  port:3306,
  dialect: "mysql",
  });


async function connectDB() {
  try {
    await sequelize.authenticate();
    console.log("Connected to MySQL database.");
  } catch (error) {
    console.error("Error connecting to the database: ", error);
  }
}

module.exports = { sequelize, connectDB };
