Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

10. Pro HTML5 Application Hacks with Nod... > Hack 85. Configure Express to Use a ...

Hack 85. Configure Express to Use a View Engine

Configuring Express to render views with a view engine provides flexibility and simplicity to our HTML templating approach.

In [Hack #84], we disabled the layout engine and configured Express to serve static HTML files. The next logical step is to begin simplifying and optimizing our views strategy. A common coding best practice is to keep our code DRY (Don’t Repeat Yourself). We will hack that together here. While we are at it, we will also briefly introduce a metalanguage called Jade and demonstrate that we can configure Express to use as an alternative to HTML. There will be more to come in our next hack about Jade and Stylus. Then we will begin to take witness of the productivity gains provided by these tools.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint