Include jQuery files in Node app's DOM on localhost <p>So I got jQuery to work in my Node app. Let's say I have the following code:</p> <pre><code>var body = '&lt;html&gt;'+ '&lt;head&gt;'+ '&lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"&gt;&lt;/script&gt;'+ '&lt;/head&gt;'+ '&lt;body&gt;'+ '&lt;script type="text/javascript"&gt;'+ '$(document).ready(function(){ alert('hey'); }); '+ '&lt;/script&gt;'+ '&lt;/body&gt;'+ '&lt;/html&gt;'; response.writeHead(200, {"Content-Type": "text/html"}); response.write(body); response.end(); </code></pre> <p>This works fine. However when I want to try and include a JS file like this (in the head):</p> <pre><code> '&lt;script type="text/javascript" src="scripts/main.js"&gt;&lt;/script&gt;' </code></pre> <p>I get a 404 error even though the script is in the right place (and the 8888 port is also the correct port) This is the error I get:</p> <pre><code> GET http://localhost:8888/scripts/main.js 404 (Not Found) </code></pre> <p>Any idea what I'm doing wrong? I'm pretty new to node.</p>