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

7
const PORT = envs.server.port || 4500;
KangMin An's avatar
KangMin An committed
8
9

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

13
14
// DB 연결
db.sequelize
15
  .sync({ force: true })
16
  .then(() => {
17
    console.log(db.msg.connection_success);
18
  })
19
  .then(() => setLocTables())
20
  .catch((err) => {
21
    console.log(db.msg.connection_err);
22
23
24
    console.log(err);
  });

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