user.route.js 958 Bytes
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("/signup")
    .post(userCtrl.signup)

한규민's avatar
한규민 committed
26
27
router
    .post("/profile", upload.single("image"), userCtrl.uploadProfile)
한규민's avatar
한규민 committed
28
29
30
31
32
33
    
router
    .route("/modify")
    .post(userCtrl.modifyUser)

router
한규민's avatar
한규민 committed
34
35
    .route("/member")
    .get(userCtrl.getMember)
한규민's avatar
한규민 committed
36

한규민's avatar
한규민 committed
37
38
39
40
router
    .route("/pw/:pw")
    .get(userCtrl.comparePw)

한규민's avatar
한규민 committed
41
42
43
44
router
    .route("/:userId")
    .get(userCtrl.compareId)

한규민's avatar
한규민 committed
45
router
한규민's avatar
한규민 committed
46
47
    .route("/phone/:phone")
    .post(userCtrl.confirmMbnum)
한규민's avatar
한규민 committed
48

한규민's avatar
한규민 committed
49
50
51
router
    .route("/num/:num")
    .get(userCtrl.confirmNum)
52
53
54

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

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