21 lines
569 B
JavaScript
21 lines
569 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
const authController = require('../controllers/authController');
|
|
|
|
// 인증 미들웨어
|
|
const authMiddleware = require('../middleware/auth');
|
|
|
|
// 로그인
|
|
router.post('/login', authController.login);
|
|
|
|
// 현재 사용자 정보 가져오기
|
|
router.get('/me', authMiddleware, authController.getCurrentUser);
|
|
|
|
// 회원가입
|
|
router.post('/register', authController.register);
|
|
|
|
// 프로필 업데이트
|
|
router.put('/profile', authMiddleware, authController.updateProfile);
|
|
|
|
module.exports = router;
|