server.js 502 Bytes
Newer Older
1
import express from 'express'
Kim, Chaerin's avatar
Kim, Chaerin committed
2
3
import connectDb from './utils/connectDb.js'
import placeRouter from './routes/place.routes.js'
4
5
6
import reviewRouter from './routes/review.routes.js'

connectDb()
7
8
9

const app = express()

Kim, Chaerin's avatar
Kim, Chaerin committed
10
app.use(express.json())
11

Kim, Chaerin's avatar
Kim, Chaerin committed
12
app.use(placeRouter)
13
14
15
16
17
18
app.use(reviewRouter)

app.get('/', (req, res) => {
    console.log("/ req.body", req.body)
    res.json({ message: "http://localhost3001/ 에 연결됨" })
})
19
20
21
22

app.listen(3001, () => {
    console.log('Server is listening on port 3001')
})