Commit e1796752 authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

Merge branch 'kimpen'

parents 7578fa34 3aafc3b2
import { Sequelize } from "sequelize";
import dbConfig from "../config/db.config.js";
const sequelize = new Sequelize(
String(dbConfig.database),
String(dbConfig.username),
dbConfig.password,
{
host: dbConfig.host,
dialect: dbConfig.dialect,
pool: {
max: dbConfig.pool?.max,
min: dbConfig.pool?.min,
acquire: dbConfig.pool?.acquire,
idle: dbConfig.pool?.idle,
},
}
);
export {
sequelize,
}
\ No newline at end of file
import dotenv from "dotenv";
import { sequelize } from "./db/index.js";
import app from "./app.js";
import appConfig from "./config/app.config.js";
dotenv.config({
path: `${process.env.NODE_ENV === "production" ? ".env" : ".env.development"
}`,
});
sequelize
.sync({ force: true })
.then(async () => {
// await Promise.all(
// Object.keys(ROLE_NAME).map((name) => {
// return Role.create({ name });
// })
// );
// const adminRole = await Role.findOne({ where: { name: "admin" } });
// await User.create({
// name: "admin",
// email: "admin@example.com",
// password: "admin!",
// isMember: true,
// roleId: adminRole?.id,
// });
app.listen(appConfig.port, () => {
console.log(`Server is running on port ${appConfig.port}`);
});
})
.catch((err) => {
console.log(err);
});
import express from "express";
const router = express.Router();
export default router;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment