Subd/server/db.ts

20 lines
592 B
TypeScript
Raw Permalink Normal View History

2024-04-23 12:08:46 +04:00
import dotenv from "dotenv";
import { Sequelize } from "sequelize-typescript";
import Role from "./models/role.model";
import User from "./models/user.model";
import Section from "./models/section.model";
import Thread from "./models/thread.model";
import Message from "./models/message.model";
dotenv.config();
export const sequelize = new Sequelize({
database: process.env.DB_NAME,
dialect: "postgres",
username: process.env.DB_USER,
password: process.env.DB_PASSWORD,
host: process.env.DB_HOST,
port: process.env.DB_PORT,
models: [Role, User, Section, Thread, Message]
});