API 명세서 - 숙제1
사용자 (Users)
게시물 (Posts)
숙제2 - router.js
- src/routes/users.router.js
// src/routes/users.router.js
// 유저 정보 조회
router.get('/users/:userId', authMiddleware, async (req, res) => {
// 유저 정보 조회 로직
// 실제 로직은 작성하지 않습니다.
}
// 유저 정보 수정
router.patch('/users/:userId', authMiddleware, async (req, res) => {
// 유저 정보 삭제
router.delete('/users/:userId', authMiddleware, async (req, res) => {
- src/routes/auth.router.js
// src/routes/auth.router.js
// 로그아웃
router.post('/auth/logout', authMiddleware, async (req, res) => {
- src/routes/posts.router.js
// src/routes/posts.router.js
// 게시물 작성
router.post('/posts', authMiddleware, async (req, res) => {
// 게시물 목록 조회
router.get('/posts', async (req, res) => {
// 게시물 상세 조회
router.get('/posts/:postId', async (req, res) => {
// 게시물 수정
router.patch('/posts/:postId', authMiddleware, async (req, res) => {
// 게시물 삭제
router.delete('/posts/:postId', authMiddleware, async (req, res) => {