chore: lint

This commit is contained in:
karishmas6
2024-09-24 17:24:24 +05:30
parent 87fa644ecf
commit 24881daa6e

View File

@@ -4,23 +4,23 @@ import dotenv from 'dotenv';
dotenv.config(); dotenv.config();
const sequelize = new Sequelize( const sequelize = new Sequelize(
process.env.DB_NAME as string, process.env.DB_NAME as string,
process.env.DB_USER as string, process.env.DB_USER as string,
process.env.DB_PASSWORD as string, process.env.DB_PASSWORD as string,
{ {
host: process.env.DB_HOST, host: process.env.DB_HOST,
dialect: 'postgres', dialect: 'postgres',
logging: false, logging: false,
} }
); );
export const connectDB = async () => { export const connectDB = async () => {
try { try {
await sequelize.authenticate(); await sequelize.authenticate();
console.log('Database connected successfully'); console.log('Database connected successfully');
} catch (error) { } catch (error) {
console.error('Unable to connect to the database:', error); console.error('Unable to connect to the database:', error);
} }
}; };
export default sequelize; export default sequelize;