PIbd-23_Dyakonov_R_R_SUBD_P.../server/db.ts

15 lines
383 B
TypeScript

import dotenv from "dotenv";
import { Sequelize } from "sequelize-typescript";
import Role from "./models/role.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]
});