title: Getting Started with express.js, serving a dynamic HTML
body: <p>I'm writing a single page web application using node.js and express. After going through some online tutorials, I found out this is how express.js serves a client directory with HTML, javascript and css</p>
  
  <pre><code>app.use(express.static(__dirname + '/public'));
  </code></pre>
  
  <p>This works great except the fact that public directory has to have .html root file which is static. I'd like to know how can I serve a dynamic HTML file with this same approach.</p>
  
  <p>I want to insert some data into the page for example "Hello user_name" at the top. How do I do that for this single file.</p>
  
  <p>I want to only do it once, at the startup, after that my application will make rest API calls and get plain JSON responses which it will then put it in the page.</p>