server.js 568 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
import reviewRouter from './routes/review.routes.js'
baesangjune's avatar
baesangjune committed
5
import appRouter from './routes/app.router.js'
6
7

connectDb()
8
9
10

const app = express()

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

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

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

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