title: how to call external javascript file in html using node.js
body: <p>I am a complete node.js newbie and struggling with the basics.I have a html file and I would like to call external javascript file in the html page using node.js in local host environment.</p>
  
  <p>JS:</p>
  
  <pre><code>var http = require('http'),
  fs = require('fs');
  fs.readFile('HtmlPage.html', function (err, html) {
    if (err) {
      throw err; 
    }
  });       
  http.createServer(function(request, response) {  
      response.writeHeader(200, {"Content-Type": "text/html"});  
      response.write(html);  
      response.end();  
  }).listen(8000);});
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;script type="text/javascript" &gt;
  function validation() {
    alert("Hai");            
    var fs = require("JavaScript1.js");
  }
  &lt;/script&gt;
  </code></pre>