"src/Quiz .js" did not exist on "75b9c5fab0c817af4bcbe7806026e941626a940a"
Commit 74c9439e authored by Kim, Subin's avatar Kim, Subin
Browse files

초기 관리자 계정 생성

parent 1cfd8a38
import dotenv from "dotenv"
import app from "./app.js"
import appConfig from "./config/app.config.js"
import { sequelize } from "./db/index.js"
import { sequelize, User } from "./db/index.js"
dotenv.config({
path: `${process.env.NODE_ENV === "production" ? ".env" : ".env.development"
......@@ -10,7 +10,17 @@ dotenv.config({
sequelize
.sync({ force: false })
.then(() => {
.then(async () => {
await User.findOrCreate({
where: { userID: "admin" },
defaults: {
userID: "admin",
userName: "관리자",
password: "admin!",
role: "admin"
}
})
app.listen(appConfig.port, () => {
console.log(`Server is running on port ${appConfig.port}`);
});
......
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