database presetup

This commit is contained in:
newtbot
2023-12-17 04:05:37 +08:00
parent 662744558d
commit ca0d24248c
4 changed files with 61 additions and 13 deletions

View File

@ -1 +1,21 @@
require("dotenv").config({ path: "../../.env" });
const Sequelize = require("sequelize");
const sequelize = new Sequelize(
"your_database_name",
process.env.
process.env.,
{
host: '',
dialect: 'mysql'
}
);
sequelize.authenticate().then(() => {
console.log('Connection has been established successfully.');
}).catch((error) => {
console.error('Unable to connect to the database: ', error);
});
module.exports = { sequelize };