title: Node.js HTML page error 404 while getting javascript
body: <p>Im working with node.js and I wanted my HTML file to GET javascript files.</p>
  
  <p>This is the file i'm running with node.js called <code>server.js</code>:</p>
  
  <pre><code>var app = require('express')();
  var http = require('http').Server(app);
  
  app.get('/', function(req, res){
    res.sendFile(__dirname + '/index.html');
  });
  
  http.listen(3000, function(){
    console.log('listening on *:3000');
  });
  </code></pre>
  
  <p>Very simple code made to host <code>index.html</code>. This HTML file has some script tags:</p>
  
  <pre><code>&lt;script type="text/javascript" src="./A.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript" src="./B.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript" src="./C.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>And the problem is that when i run <code>server.js</code> and I go to the browser I get this errors on the console:</p>
  
  <pre><code>GET http://localhost:3000/A.js 
  GET http://localhost:3000/B.js 
  GET http://localhost:3000/C.js 404 (Not Found)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/zcxeE.png" rel="nofollow noreferrer">404 error not found</a></p>
  
  <p>The files are all in the same directory and I don't understand why it doesn't get the scripts.</p>