Following the similar steps in the previous example, you can complete the template rendering for all other CRUD routes:
- The updated JournalRoutes is shown in the following:
import Vaporimport Leafstruct JournalRoutes : RouteCollection { let journal = JournalController() let mainPage = "/journal/all" let title = "My Journal" let author = "Angus" struct JournalContext : Encodable { let title: String let author: String let count: String let entries: [Entry] } struct EntryContext : Encodable { let title: String let author: String let index: Int let entry: Entry } func boot(router: Router) throws { let topRouter = router.grouped("journal") topRouter.get("", use: getAll) topRouter.get("all", use: getAll) topRouter.get("create", ...