server.js 697 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'
Lee SeoYeon's avatar
0113    
Lee SeoYeon committed
6
7
import userRouter from "./routes/user.routes.js"
import authRouter from "./routes/auth.routes.js"
8
9

connectDb()
10
11
12

const app = express()

Kim, Chaerin's avatar
Kim, Chaerin committed
13
app.use(express.json())
14

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

Lee SeoYeon's avatar
0113    
Lee SeoYeon committed
19
20
app.use(userRouter)
app.use(authRouter)
21
22
23
24
25

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

app.listen(3001, () => {
Lee SeoYeon's avatar
0111    
Lee SeoYeon committed
28
    console.log('Listening on port 3001')
29
})