team4-campick / campick-server

0 stars 1 forks source link

[마이페이지 리팩토링] #75

Closed leedbswo107 closed 2 days ago

leedbswo107 commented 1 month ago
  1. 컨트롤러, 서비스 분리

  2. response 요소명 통일 (success -> result)

  3. 함수 호출 선언부 통일

  4. route (get, post, delete, put) 요청 함수로 경로 구분 (get('/get-post-list') -> get('/post-list'))

    • GET: getting data
    • POST: creating data
    • PUT: updating data
    • DELETE: deleting data
  5. 불필요한 콘솔 출력 제거

  6. 불필요한 코드 제거

  7. 반복 사용 코드 모듈화 +) 관리 및 수정이 필요한 사항은 진행하면서 추가될 예정.

leedbswo107 commented 1 month ago

route 경로 정의는 체이닝 방식이 더 일반적인 것으로 확인되어 겹치는 경로는 체이닝 방식으로 변경할 예정.

leedbswo107 commented 1 month ago

router 체이닝 방식에서 http method는 GET, POST, PUT, DELETE 순으로 작성할 예정.

leedbswo107 commented 1 month ago

기존의 코드 형식 변경

Before modification

const express = require('express'); const router = express.Router();

After modification.

const { Router } = require('express'); const router = Router();

leedbswo107 commented 1 month ago

http status code 정리 필요. 1xx : informational 2xx : success 3xx : redirection 4xx : client error 5xx : server error

[참고 사이트] https://hongong.hanbit.co.kr/http-%EC%83%81%ED%83%9C-%EC%BD%94%EB%93%9C-%ED%91%9C-1xx-5xx-%EC%A0%84%EC%B2%B4-%EC%9A%94%EC%95%BD-%EC%A0%95%EB%A6%AC/

leedbswo107 commented 2 days ago

8월 9일부 리팩토링 종료