I have looked at a lot of similar questions but I can't get it to work, so I'll just ask it myself
I have a folder like this:
Source Code
Frondend
Graphs.html
Graphs.css
Temperature.js
Server_Backend
server.js
I want to run these file with node.js, I can also use express if necessary.
I have this in server.js to load my html:
fs.readFile('../Frondend/Graphs.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(8080);
});
these are the links in my html header:
<script type="text/javascript" src="Temperature.js"></script>
<link rel="stylesheet" type="text/css" href="Graphs.css">
How do I also include my css and js file? As I said I tried a lot of things already but I can't seem to get it to work.