© Christopher Pitt 2018
Christopher PittThe Definitive Guide to AdonisJshttps://doi.org/10.1007/978-1-4842-3390-0_3

3. Views

Christopher Pitt1 
(1)
Cape Town, Western Cape, South Africa
 

In the previous chapter, we created many new routes. These will direct traffic to many parts of our application. We looked at how to match specific request methods and how to add parameters to the endpoint URLs.

Let’s take this a step further by rendering HTML for some of those endpoints. We could take a few approaches, including returning a string of HTML directly from a route handler or rendering a template. We’re going to focus on the latter, as we learn new Ace commands and the Edge template syntax.

Creating Views

Let’s ease into this topic by creating a new template ...

Get The Definitive Guide to AdonisJs: Building Node.js Applications with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.