userRouter.js
600 Bytes
const express = require ('express');
const router = express.Router();
const { guestOnly, memberOnly, adminOnly } = require ('../middlewares/auth')
const userController = require ('../controllers/userController')
router.post('/user/register', guestOnly, userController.userRegister)
router.post('/user/update', memberOnly, userController.userUpdate)
router.post('/admin/user/list', adminOnly, userController.adminUserList)
router.post('/admin/user/info', adminOnly, userController.adminUserInfo)
router.post('/admin/user/upsert', adminOnly, userController.adminUserUpsert)
module.exports = router