Skip to Content
Node.js 6.x Blueprints
book

Node.js 6.x Blueprints

by Fernando Monteiro
August 2016
Intermediate to advanced
376 pages
6h 33m
English
Packt Publishing
Content preview from Node.js 6.x Blueprints

Creating the application views

Our next step is to build the application views files, so we will create new files within the views directory using the .ejs extension.

  1. Create a new file called error.ejs and add the following code:
          <% include header %> 
             <div class="container"> 
               <h1><%- error.status %></h1> 
               <h4><%- message %></h4> 
              <p><%- error.stack %></p> 
            </div> 
          <% include footer %> 
     
    
  2. Create a file called footer.ejs and add the following lines of code:
          <script src="https://cdn.socket.io/socket.io-1.4.5.js"></script> 
          <script src="js/main.js"></script> 
          </body> 
          </html> 
    

    Note that we already included the Socket.io client file from a Content Delivery Network (CDN). Don't worry about the main.js file at the end of footer.ejs; we will create this file in the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Node.js Development

Learning Node.js Development

Andrew Mead
VB.NET Core Classes in a Nutshell

VB.NET Core Classes in a Nutshell

Budi Kurniawan, Ted Neward
Your First Week With Node.js, 2nd Edition

Your First Week With Node.js, 2nd Edition

James Hibbard, Craig Buckler, Mark Brown, Nilson Jacques, James Kolce, Paul Orac, M. David Green, Florian Rappl

Publisher Resources

ISBN: 9781785888434Supplemental Content