Commit ff5b4aaa authored by Kim, Subin's avatar Kim, Subin
Browse files

postgreSQL 연결

parent 42c6375b
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 || 'butterDB', database: process.env.PG_DATABASE || 'todayKUDB',
dialect: 'postgres', dialect: 'postgres',
pool: { pool: {
max: 10, max: 10,
......
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}`);
......
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