title: Express problem with router readning head.html and tail.html files
body: <p>I'm a student and we are staring with Express and I have a little question.</p>
  <p>In my <strong>routes/index.js</strong> file I have this:</p>
  <pre><code>router.post('/orders.html', function(req, res, next) {
      var fhead = __dirname+ &quot;/../views/head.html&quot;;
      var head = fs.readFileSync(fhead, 'utf-8');
  
      var ftail = __dirname+ &quot;/../views/tail.html&quot;;
      var tail = fs.readFileSync(ftail, 'utf-8'); 
  
      //Do I need to add this???
      //res.render('index', function (err, html) {
      //  if(err) throw err; }
  
      var item = req.body.item;
      var quantity = req.body.quanty;
      var name = req.body.name;
  
      var rep = item + &quot; was ordered &quot; + quantity + 
      &quot; times by &quot; + name;
  
      res.send(head + rep + tail);
  });
  </code></pre>
  <p>When I open my post orders.html the CSS is not okay and I don't understand why? It has everything it's supposed to have but the CSS.</p>
  <p>But, when I open my head.html or tail.html file everything works perfectly!</p>
  <p><strong>head.html</strong></p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset=&quot;UTF-8&quot;&gt;
  &lt;title&gt;TITLE&lt;/title&gt;
  &lt;link rel=&quot;stlesheet&quot; style=&quot;text/css&quot; href=&quot;bs/css/bootstrap.min.css&quot;&gt;
  &lt;link rel=&quot;stylesheet&quot; style=&quot;text/css&quot; href=&quot;../public/css/style.css&quot;&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;../javascript/popup.js&quot;&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;header&gt;
          &lt;a href=&quot;index.html&quot; target=&quot;_self&quot;&gt; 
          &lt;img src=&quot;../public/images/logo.png&quot; alt=&quot;Logo&quot;&gt;&lt;/a&gt;
          &lt;h1 id=&quot;titre&quot;&gt;SHOP&lt;/h1&gt;
          &lt;nav class=&quot;navbar navbar-default&quot;&gt;
              Nav bar
              &lt;ul class=&quot;horizontalbar&quot;&gt;
                  &lt;li onclick=&quot;popup()&quot;&gt;Me&lt;/li&gt;
                  &lt;li&gt;&lt;a href=&quot;contact.html&quot; target=&quot;_self&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href=&quot;orders.html&quot; target=&quot;_self&quot;&gt;Orders&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/nav&gt;
      &lt;/header&gt;
      &lt;div class=&quot;container&quot;&gt;
          &lt;h1&gt;Wellecome!&lt;/h1&gt;
          &lt;p1&gt;babla&lt;/p1&gt;
  </code></pre>
  <p><strong>tail.html</strong></p>
  <pre><code>&lt;link rel=&quot;stylesheet&quot; style=&quot;text/css&quot; href=&quot;../public/css/tail.css&quot;&gt;
  &lt;div class=&quot;foot&quot;&gt;
    &lt;span&gt;textext&lt;/span&gt;
    &lt;a href = &quot;mailto: mail@com&quot;&gt;Me&lt;/a&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>Can you guys help me, why it doesn't work?</p>
  <p>I have a question too, normally is it better to make my <em>index</em>, <em>orders</em>, <em>contact</em> html files with ALL the code, or only the body? If it only has the body I can call head + THE PAGE + tail and I repeat less code, is it a good way to work? Or it is better to write everything?</p>
  <p>Thanks a lot!</p>