index.js 494 Bytes
Newer Older
Kim, Chaerin's avatar
Kim, Chaerin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { Sequelize } from "sequelize";
import UserModel from "./user.model.js";
import RoomModel from "./room.model.js";

const env = process.env.NODE_ENV || "development";
import configs from "../config/config.js";
const config = configs[env];

const sequelize = new Sequelize(
  config.database,
  config.username,
  config.password,
  { host: config.host, dialect: config.dialect }
);

const User = UserModel(sequelize);
const Room = RoomModel(sequelize);

export { sequelize, User, Room };