index:
const fs = require("fs");
const path = require('path');
const { sequelize } = require("sequelize");
const { connection } = require('connection');
sequelize
.authenticate()
.then(function(err) {
console.log('Connection has been established successfully.');
})
.catch(function (err) {
console.log('Unable to connect to the database:', err);
});
connection:
require('dotenv').config()
const fs = require("fs");
const Sequelize = require("sequelize");
module.exports = connection = {
username: process.env.DB_USER,
password: process.env.DB_PASS,
database: process.env.DB_NAME,
host: process.env.HOST_DB,
dialect: "mysql",
timezone: "+03:00",
dialectOptions: {
charset: "utf8mb4",
},
logging: false
};
module.exports = {
development: connection
};
.authenticate()
^
TypeError: Cannot read properties of undefined (reading 'authenticate')
Не могу найти решение почему, я не могу законектится к бд, подскажите пожалуйста где моя ошибка,