Post

Refactoring_Restful API URI

βœ… Mid Feedback

In order for the API to be Representational of the State, it should follow some conditions.
It should have a uniform interface.
Thus, the URIs have to explain the resource.

πŸ‘ŽπŸ» Before to πŸ‘πŸ» After

βœ”οΈ Auth

πŸ‘ŽπŸ» URI BeforeMethodπŸ‘πŸ» URI After
auth/sign-upPOST/auth/sign-up
auth/loginPOST/auth/login
auth/nickname-checkGET/auth/nickname
auth/email-checkGET/auth/email
auth/findEmailGET/auth/find-email
auth/change-passwordPUT/auth/password
email/sendGET/email/send
email/auth-num-checkGET/email/auth-num

βœ”οΈ Cart

πŸ‘ŽπŸ» URI BeforeMethodπŸ‘πŸ» URI After
cart/myCartGET/cart
cart/addPOST/cart
cart/updatePUT/cart
cart/deleteDELETE/cart
cart/emptyDELETE/cart/empty

βœ”οΈ Likes

πŸ‘ŽπŸ» URI BeforeMethodπŸ‘πŸ» URI After
likesPOST/likes
likes/deelteDELETE/likes
likes/mylikesGET/likes

βœ”οΈ Main Page

πŸ‘ŽπŸ» URI BeforeMethodπŸ‘πŸ» URI After
/mainGET/main
main/categoryGET/main/category
main/findGET/main/find

βœ”οΈ Detail

πŸ‘ŽπŸ» URI BeforeMethodπŸ‘πŸ» URI After
product/detailGET/product
product/review/{productId}POST/product/review/{productId}
product/question/listGET/product/question
product/questionPOST/product/question
product/answerPOSTproduct/answer
product/question/delDELETE/product/question
product/question/updatePUT/product/question

βœ”οΈ MyPage

πŸ‘ŽπŸ» URI BeforeMethodπŸ‘πŸ» URI After
mypage/review/addPOST/mypage/review/{ordersId}
mypage/review/updatePUT/mypage/review/{ordersId}
mypage/review/deleteDELETE/mypage/review/{ordersId}
mypage/productGET/mypage/order
mypage/userInfoGET/mypage/userInfo
mypage/question/getGET/mypage/question
mypage/reviewsGET/mypage/reviews
mypage/coupon/getGET/mypage/coupon

βœ”οΈ Order

πŸ‘ŽπŸ» URI BeforeMethodπŸ‘πŸ» URI After
order/cartToOrderGET/order/cart-to-order
order/payPUT/order/order-to-pay
admin/addProductPOST/admin/product
This post is licensed under CC BY 4.0 by the author.