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

postgreSQL 연결

parent 42c6375b
const config = {
host: 'localhost',
// username: process.env.PG_USER || 'butter',
// password: process.env.PG_PASSWORD || 'butter',
// database: process.env.PG_DATABASE || 'butterDB',
username: process.env.PG_USER || 'kuku',
password: process.env.PG_PASSWORD || 'kuku0725',
database: process.env.PG_DATABASE || 'todayKUDB',
dialect: 'postgres',
pool: {
max: 10,
......
import dotenv from "dotenv"
import app from "./app.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({
path: `${process.env.NODE_ENV === "production" ? ".env" : ".env.development"
......@@ -10,7 +9,7 @@ dotenv.config({
});
sequelize
// .sync({ force: false })
.sync({ force: false })
.then(() => {
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