I am learning how to use Node.js but I'm stuck. I am unable to load css and js files in my project. I am loading Bootstrap and Fontawesome from a CDN and they're rendering fine. As for my own custom css and js, they are not loading at all.
My folder file path:
folder
index.html
app.js
package.json
css
main.css
files
file.pdf
app.js:
var http = require('http');
var fs = require('fs');
//creating server
http.createServer(function (req, res) {
fs.readFile('index.html', function (err, html) {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.write(html);
res.end();
});
}).listen(8080);
