I have got my directory structure like this in a nodejs project
And here's my login_nimda.html
snippet with the CSS links:
I am serving login_nimda.html
from nimda.js
but the associated CSS file isn't loading up.
As you can see I have used root-relative path but I am still not getting any results. The same reason why I had to use the CDN for Bootstrap and couldn't use the downloaded file.
How is it supposed to be? Where am I going wrong with the href
attribute of the link?
EDIT:
Here's my nimda.js
snippet that is serving the HTML file login_nidma.html
router.get('/', function( req, res){
let html = fs.readFileSync(path.join(__dirname,'../static/login_nimda.html'));
res.writeHead(200, {'Content-Type': 'text/html'});
res.end(html);
});