14.9.2 댓글 조회하기
다음으로 댓글을 조회하는 기능을 만들 차례입니다. 댓글 작성하기 API와 같은 주소를 사용하고 GET 메서드를 사용합니다.
api/comment/config/route.json
{
"routes": [
{
()
},
{
"method": "GET",
"path": "/articles/:articleId/comments",
"handler": "article.find",
"config": {
"policies": []
}
}
]
}
route.json 파일을 수정한 다음에는 핸들러를 작성하세요.