In addition to implementing the standard route handling, you also need to implement route handling to interact with the database. You break these route handlers out of the standard comments_route.js
file and into their own files for each model, to keep the code clean and ensure a good division of responsibilities.
The following sections cover the implementation of the model-specific controllers for the Page
, Photo
, and CommentThread
models.