server.js 697 Bytes
Newer Older
Lee SeoYeon's avatar
commit    
Lee SeoYeon committed
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'
Lee SeoYeon's avatar
0113    
Lee SeoYeon committed
5
6
import userRouter from "./routes/user.routes.js"
import authRouter from "./routes/auth.routes.js"
baesangjune's avatar
baesangjune committed
7
import appRouter from './routes/app.router.js'
Lee SeoYeon's avatar
0111    
Lee SeoYeon committed
8
9

connectDb()
Lee SeoYeon's avatar
commit    
Lee SeoYeon committed
10
11
12

const app = express()

Lee SeoYeon's avatar
0111    
Lee SeoYeon committed
13
app.use(express.json())
Lee SeoYeon's avatar
commit    
Lee SeoYeon committed
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
26

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

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