index.js 407 Bytes
Newer Older
Park Sungwoo's avatar
Park Sungwoo committed
1
2
import mongoose from "mongoose";
import app from "./app.js";
Park Sungwoo's avatar
push    
Park Sungwoo committed
3
4
const port = 3000;

Park Sungwoo's avatar
Park Sungwoo committed
5
6
7
8
9
10
11
mongoose
    .connect("mongodb://127.0.0.1:27017/test")
    .then((mgs) => {
        console.log(`버전 ${mgs.version} 몽구스 : 몽고디비가 접속되었습니다.`);
        app.listen(port, () =>{
            console.log(`server is running at ${port} port. `);
    })
Park Sungwoo's avatar
push    
Park Sungwoo committed
12
})
Park Sungwoo's avatar
Park Sungwoo committed
13
14
.catch((error) => {
    console.log(error);
Park Sungwoo's avatar
push    
Park Sungwoo committed
15
})