title: node.js Template HTML Files
body: <p>I'm fairly new to node.js and I'm wondering if there is a way to generate the HTML files from express post requests.</p>
  
  <pre><code>app.post('/getVideo', function(req, res) {
      fs.readdir('./videos', function(err, items) {
          var toSend = "&lt;ul&gt;";
          for (var i = 0; i &lt; items.length; i++) {
              toSend += "&lt;li class='fileType' data-id='"+items[i]+"'&gt;"+items[i]+"&lt;/li&gt;";
          }
          toSend += "&lt;/ul&gt;";
      });
  });
  </code></pre>
  
  <p>This works, however it uses an empty HTML page.  Is there a way where I can provide an HTML page as a form of template, and input values into specific ids or something, much like an MVC.</p>
  
  <p>I know I can push a page using:</p>
  
  <pre><code>res.sendFile(__dirname+"/public/getVideos.html");
  </code></pre>
  
  <p>However, this then gets overwritten by any other res.sends.</p>
  
  <p>I'm aware that you can do something like this with .NET and MVCs like React and Angular, I was just wondering if node had any module that allowed for something like this.</p>
  
  <p>Thanks in advance,</p>
  
  <p>Any help is appreciated.</p>