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

2. Routing

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

In the previous chapter, we set up our environment and got our first look at the structure of an AdonisJs application. Now it’s time to add HTTP endpoints to the application. This is done by adding routes. We’ll learn about all the ways to customize routes, use the data they hold, and respond to any request.

What Are Routes?

Routes are like glue between the HTTP requests your browser makes and the server code meant for each request. This isn’t the first time we’re seeing them, either. In the previous chapter, we created a /registration route (though we didn’t do any ...

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.