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
ff5b4aaa
Commit
ff5b4aaa
authored
Sep 29, 2021
by
Kim, Subin
Browse files
postgreSQL 연결
parent
42c6375b
Changes
2
Hide whitespace changes
Inline
Side-by-side
server/config/db.config.js
View file @
ff5b4aaa
const
config
=
{
const
config
=
{
host
:
'
localhost
'
,
host
:
'
localhost
'
,
//
username: process.env.PG_USER || '
butter
',
username
:
process
.
env
.
PG_USER
||
'
kuku
'
,
//
password: process.env.PG_PASSWORD || '
butter
',
password
:
process
.
env
.
PG_PASSWORD
||
'
kuku0725
'
,
//
database: process.env.PG_DATABASE || '
butter
DB',
database
:
process
.
env
.
PG_DATABASE
||
'
todayKU
DB
'
,
dialect
:
'
postgres
'
,
dialect
:
'
postgres
'
,
pool
:
{
pool
:
{
max
:
10
,
max
:
10
,
...
...
server/index.js
View file @
ff5b4aaa
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
"
sequelize
"
import
{
sequelize
}
from
"
./db/index.js
"
// import { sequelize } 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 +9,7 @@ dotenv.config({
...
@@ -10,7 +9,7 @@ dotenv.config({
});
});
sequelize
sequelize
//
.sync({ force: false })
.
sync
({
force
:
false
})
.
then
(()
=>
{
.
then
(()
=>
{
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