index.ts 370 Bytes
Newer Older
1
import { connect } from "mongoose";
Yoon, Daeki's avatar
Yoon, Daeki committed
2
import app from "./app";
3
import { mongoUri } from "./config";
Yoon, Daeki's avatar
Yoon, Daeki committed
4

5
6
7
8
9
10
11
12
13
14
connect(mongoUri)
  .then((mgs) => {
    console.log(`Mongoose is connected with version: ${mgs.version}`);
    app.listen(3000, () => {
      console.log(`server is running on port ${3000}`);
    });
  })
  .catch((error) => {
    console.log(`에러: ${error}`);
  });