Skip to content

Commit

Permalink
[BE][Feat] : #42 : 로그인 api 구현
Browse files Browse the repository at this point in the history
- 로그인을 위한 패키지 (bcrypt, express-validator, jsonwebtoken) 설치
- 로그인을 위한 router, controller, service, repository, middleware 구현
- index.js router 호출 및 사용
- 로그인 api 구현 테스트
  • Loading branch information
happyhyep committed Nov 11, 2024
1 parent b18870b commit cd60fab
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions backend/src/routes/authRouter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import express from 'express';
import { body } from 'express-validator';
import { login } from '../controllers/authController.js';
import validationMiddleware from '../middleware/validationMiddleware.js';

export const router = express.Router();

router.post(
'/login',
[
body('id').notEmpty().withMessage('ID is required'),
body('password')
.isLength({ min: 6 })
.withMessage('Password must be at least 6 characters long'),
],
validationMiddleware,
login,
);

0 comments on commit cd60fab

Please sign in to comment.