user.route.js 1.07 KB
Newer Older
한규민's avatar
한규민 committed
1
2
import express from "express";
import userCtrl from "../controllers/user.controller.js";
한규민's avatar
한규민 committed
3
import multer from "multer"
한규민's avatar
한규민 committed
4
5

const router = express.Router();
한규민's avatar
한규민 committed
6
7
8
const upload = multer({
    dest: "upload/"
})
한규민's avatar
한규민 committed
9

한규민's avatar
한규민 committed
10
11
12
13
router
    .route("/user")
    .get(userCtrl.getUser)

한규민's avatar
한규민 committed
14
router
한규민's avatar
한규민 committed
15
16
17
    .route("/login")
    .post(userCtrl.login)

한규민's avatar
context    
한규민 committed
18
19
20
21
router
    .route("/logout")
    .get(userCtrl.logout)

한규민's avatar
한규민 committed
22
23
24
25
router
    .route("/guest")
    .post(userCtrl.guestLogin)

한규민's avatar
한규민 committed
26
27
28
29
router
    .route("/signup")
    .post(userCtrl.signup)

한규민's avatar
한규민 committed
30
31
router
    .post("/profile", upload.single("image"), userCtrl.uploadProfile)
32

한규민's avatar
한규민 committed
33
34
35
36
37
router
    .route("/modify")
    .post(userCtrl.modifyUser)

router
한규민's avatar
한규민 committed
38
39
    .route("/member")
    .get(userCtrl.getMember)
40
41
42
43
    
router
        .route("/num")
        .post(userCtrl.confirmNum)
한규민's avatar
한규민 committed
44
45
46
47
router
    .route("/pw/:pw")
    .get(userCtrl.comparePw)

한규민's avatar
한규민 committed
48
router
한규민's avatar
한규민 committed
49
50
    .route("/phone/:phone")
    .post(userCtrl.confirmMbnum)
한규민's avatar
한규민 committed
51

52
53
54

router.route('/getuserinfo')
    .post(userCtrl.getUserInfo)
한규민's avatar
한규민 committed
55

Jiwon Yoon's avatar
Jiwon Yoon committed
56
57
58
router.route('/guest/save')
    .post(userCtrl.saveGuestInfo)

59
60
61
router.route('/guestinfo/:guestId')
    .get(userCtrl.getGuestInfo)

한규민's avatar
한규민 committed
62
export default router;