init.js 493 Bytes
Newer Older
KangMin An's avatar
KangMin An committed
1
2
import app from "./app";
import dotenv from "dotenv";
3
import "./schedules"; // 매일 자정 데이터 처리
4
import db from "./db/index";
5

KangMin An's avatar
KangMin An committed
6
7
8
9
10
dotenv.config();

const PORT = process.env.PORT || 4500;

const handleListening = () => {
11
  console.log(`✅ Listening on : http://localhost:${PORT}`);
KangMin An's avatar
KangMin An committed
12
13
};

14
15
16
17
18
19
20
21
22
23
// DB 연결
db.sequelize
  .sync({ force: false })
  .then(() => {
    console.log("DB Connect Suceecs!");
  })
  .catch((err) => {
    console.log(err);
  });

KangMin An's avatar
KangMin An committed
24
app.listen(PORT, handleListening);