Book Image

Mastering Web Application Development with Express

By : Alexandru Vladutu
Book Image

Mastering Web Application Development with Express

By: Alexandru Vladutu

Overview of this book

Table of Contents (18 chapters)
Mastering Web Application Development with Express
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


In this chapter, we learned how to differentiate template engines and what the characteristics of each category are. We then studied how to extract complex logic from templates to view helpers and how to make globally-accessed variables (for all the views).

By using layouts and partial views, we managed to eliminate repetition and keep our code base DRY.

Next, we tackled the importance of view caching and how to clear the cache without restarting the server once the templates have been updated.

In the final part of the chapter, we integrated a template engine with Express by providing the correct function signature needed by the framework as well as other advanced features such as partials, layouts, and caching.

In the next chapter, we will look at other modules and techniques that help us keep our code base DRY. We will discover ways of handling control flow with tiny modules, elegant error checking, creating custom errors, and making sure callbacks are executed only once.