From 74c9439e9796e89452054a3de664892cef09930c Mon Sep 17 00:00:00 2001 From: ksbin1025 Date: Tue, 2 Nov 2021 22:18:20 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B4=88=EA=B8=B0=20=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=EC=9E=90=20=EA=B3=84=EC=A0=95=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/index.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/server/index.js b/server/index.js index 52d57f3..4c82af7 100644 --- a/server/index.js +++ b/server/index.js @@ -1,7 +1,7 @@ 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}`); }); -- GitLab