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 ...

Get Node.js 6.x Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.