In the previous chapter, we covered several topics related to Vapor applications, such as how to extend the functionality of a Vapor application using Providers, and we dove into the Fluent provider as it is the most-used Provider in any Vapor application. It is also Vapor's and Swift's ORM to create, read, update, and delete data in the database using a high-level API. In this chapter, we will cover another important topic in building web applications that are related to routing, especially when building an API server.
Giving structure to our routes makes our applications easier to manage and easier for others to consume. There are several popular patterns in the industry when it comes to creating routes for your application, especially when building API routes to perform actions, such as create, read, update, and delete, on a specific...