REST API 컨벤션 Top5! 단수, 복수, 네이밍 등의 url 설계를 위한 best practice 알아보기

<aside> <img src="https://avatars2.githubusercontent.com/u/7658037?v=3&s=400" alt="https://avatars2.githubusercontent.com/u/7658037?v=3&s=400" width="40px" /> Swagger

Swagger UI

http://49.50.172.154/api/api#/

</aside>

1. 유저 정보

— POST /user/login/callback

GitHub 콜백용 URL

— GET /user/profile

유저 정보 요청

Response: {
	200 Ok
	body: {
			id,
			name,
			nodeId,
			profileURL,
	}
}

2. 개인 페이지 메인

GET /user-document/recent

내가 방문한 모든 문서들을 최근 방문한 순서대로 정렬하여 반환한다.

Response: {
	200 ok
	body: {
		documents: [
			{
				id,
				title,
				lastVisited,
				role,
				isBookmarked,
				createdAt,
			},
			{
				id,
				title,
				lastVisited,
				role,
				isBookmarked,
				createdAt,
			},
			...
		]
	}
}

3. 에디터 페이지

문서 접근

GET /document/:document_id

Response: {
	200 ok
	body:{
		document: {
					id,
					title,
					content,
					createdAt,
		}
	}
}

PATCH /user-document/:document_id