Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
Today KU
Commits
74c9439e
Commit
74c9439e
authored
Nov 02, 2021
by
Kim, Subin
Browse files
초기 관리자 계정 생성
parent
1cfd8a38
Changes
1
Show whitespace changes
Inline
Side-by-side
server/index.js
View file @
74c9439e
import
dotenv
from
"
dotenv
"
import
dotenv
from
"
dotenv
"
import
app
from
"
./app.js
"
import
app
from
"
./app.js
"
import
appConfig
from
"
./config/app.config.js
"
import
appConfig
from
"
./config/app.config.js
"
import
{
sequelize
}
from
"
./db/index.js
"
import
{
sequelize
,
User
}
from
"
./db/index.js
"
dotenv
.
config
({
dotenv
.
config
({
path
:
`
${
process
.
env
.
NODE_ENV
===
"
production
"
?
"
.env
"
:
"
.env.development
"
path
:
`
${
process
.
env
.
NODE_ENV
===
"
production
"
?
"
.env
"
:
"
.env.development
"
...
@@ -10,7 +10,17 @@ dotenv.config({
...
@@ -10,7 +10,17 @@ dotenv.config({
sequelize
sequelize
.
sync
({
force
:
false
})
.
sync
({
force
:
false
})
.
then
(()
=>
{
.
then
(
async
()
=>
{
await
User
.
findOrCreate
({
where
:
{
userID
:
"
admin
"
},
defaults
:
{
userID
:
"
admin
"
,
userName
:
"
관리자
"
,
password
:
"
admin!
"
,
role
:
"
admin
"
}
})
app
.
listen
(
appConfig
.
port
,
()
=>
{
app
.
listen
(
appConfig
.
port
,
()
=>
{
console
.
log
(
`Server is running on port
${
appConfig
.
port
}
`
);
console
.
log
(
`Server is running on port
${
appConfig
.
port
}
`
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment