UNPKG

chetajs

Version:

Chetajs is a NodeJS cli generator for scaffolding ExpressJs applications

22 lines (19 loc) 577 B
import { Sequelize } from 'sequelize' import 'dotenv/config' const initSequelize = () => { try { return new Sequelize(process.env.DB_URI, { dialect: 'postgres', logging: false, dialectOptions: { // ssl: { // rejectUnauthorized: true // } } }) } catch (error) { console.log('Unable to connect to the database. Ensure you have the right connection string'); } } export const sequelize = initSequelize() sequelize.sync()