title: How to include javascript on client side of node.js?
body: <p>I'm a beginner of node.js and javascript.</p>
  
  <p>I want to include external javascript file in html code. Here is the html code, "index.html":</p>
  
  <pre><code>&lt;script src="simple.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>And, here is the javascript code, "simple.js":</p>
  
  <pre><code>document.write('Hello');
  </code></pre>
  
  <p>When I open the "index.html" directly on a web browser(e.g. Google Chrome), It works.
  ("Hello" message should be displayed on the screen.)</p>
  
  <p>However, when I tried to open the "index.html" via node.js http server, It doesn't work.
  Here is the node.js file, "app.js":</p>
  
  <pre><code>var app = require('http').createServer(handler)
    , fs = require('fs')
  
  app.listen(8000);
  
  function handler (req, res) {
    fs.readFile(__dirname + '/index.html',
    function (err, data) {
      if (err) {
        res.writeHead(500);
        return res.end('Error loading index.html');
      }
  
      res.writeHead(200);
      res.end(data);
    });
  }
  </code></pre>
  
  <p>("index.html", "simple.js" and "app.js" are on same directory.)
  I started the http server. (by "bash$node app.js")
  After then, I tried to connect "localhost:8000".
  But, "Hello" message doesn't appear.</p>
  
  <p>I think the "index.html" failed to include the "simple.js" on the http server.</p>
  
  <p>How should I do?</p>