title: Express & EJS - layout.ejs not used
body: <p>Im trying out EJS as a view engine with Express. It seems that my layout.ejs is not used. I have two views index.ejs and layout.ejs both in my 'views' folder. It seems that index.js is rendered but layout.ejs is not. The layout.ejs file should be including a CSS file but when the page is rendered in the browser this is not there. Any test test text that I place in the layout.ejs file is not output with the response.</p>
  
  <p>Am I missing an additional configuration step?</p>
  
  <p>Thanks!</p>
  
  <p>My server.js code:</p>
  
  <pre><code>var express = require('express');
  
  var app = express();
      app.set('view engine', 'ejs');
      app.use(express.static(__dirname + '/public'));
      app.get('/', function(req, res){
              res.render('index.ejs', {title: 'EJS Engine'});
      });
  
      app.listen(8080);
  </code></pre>
  
  <p>In my layout.ejs I am linking to a single css file which resides in the public folder. </p>
  
  <p>layout.ejs:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
         &lt;html&gt;
         &lt;head&gt;
             &lt;title&gt;&lt;%= title %&gt;&lt;/title&gt;
              &lt;link rel="stylesheet" type="text/css" href="main.css"&gt;
         &lt;/head&gt;
         &lt;body&gt;
                &lt;%- body %&gt;
         &lt;/body&gt;
         &lt;/html&gt; 
  </code></pre>
  
  <p>index.ejs</p>
  
  <pre><code>&lt;div id="container"&gt;
          index.html
  &lt;/div&gt;
  </code></pre>