In this chapter, you created a web page using Vapor. By now, you should have a good understanding of how Leaf works and how you can use it in any of the server-side Swift packages along with your Vapor app. You also learned the best practice of refactoring your code so that you can share code between both of your controllers using the powerful feature of generics available in Swift. You also created a Vapor middleware to dynamically generate HTML or JSON output for your request so that you can use the same routes for both your iOS app and the web app you just created.
Hopefully, this chapter gave you background on server-side rendering of HTML templates and how you can add CSS and JavaScript. Using some CSS, you were able to make your page look nice, and adding some JavaScript, you were able to make your web page link a single page app without having to write a lot of code or having to set up a build pipeline for your assets.
In the next chapter, you will learn the best practices for...