URI (end point) 는 명사형으로 작성.
path parameter 는 camelCase로 써주세요. 이유: 코드 상에서 사용되는 변수
GET → json type
POST
201 로 통일
If one or more resources has been created on the origin server as a result of successfully processing a POST request, the origin server SHOULD send a 201 (Created) response containing a Location header field that provides an identifier for the primary resource created (Section 10.2.2) and a representation that describes the status of the request while referring to the new resource(s).
[header]
Location: /posting/1
[body]
{
postingId: 1,
}
PUT/PATCH
204 No Content
DELETE
204 No Content
NestJS 에서 제공하는 HTTPException 을 throw 하는 방식으로 에러 처리.
(메세지는 자세하게)
{
“statusCode”: number,
“message”: string,
“error”: string
}
postings, users, hashtags 등등