title: Node.js serve HTML, but can't load script files in served page
body: <p>i'm trying to make a little login page using a mongoDB database and Node.js + express. I'm new to Node.js so maybe the solution is easier than i thought.
  The problem is: when i serve the HTML file when connecting to the server page, i can't use the JavaScript file referenced in the html file. How can i fix it?
  P.s the index.html and client.js files are all located in a folder named "client".</p>
  
  <p>Code:</p>
  
  <pre><code>var express = require('express');
  var path = require('path');
  var app = express();
  app.use(express.static(__dirname + 'client'));
  app.get('/', function(req, res) {
      res.sendFile(path.join(__dirname + '/client/index.html'));
  });
  </code></pre>
  
  <p>HTML File:</p>
  
  <pre><code> &lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Login&lt;/title&gt;
      &lt;meta name="description" content="Login Page"&gt;
      &lt;meta name="author" content="AlbertoCoder"&gt;
      &lt;script src="/client/client.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>