I am beginner in the field of node js.No idea how to send simple request from url Like :- http://localhost:9999/xyz/inde.html my file hierarchy is
server.js
xyz
its very simple, node already provide fs module from which u can read that html file and append on response obj like this:
response.writeHead(200, {"Content-Type": "text/plain"});
//here is the code required
fs.readFile("./xyz/index.html", (err,fileContent) =>
{
response.end(fileContent);
});
but the problem here is you will only get the HTML document not the resources inside that HTML files which are stored in different folders like if you have this code in your index.html
this index.css will not be allowed by the node server. But i guess your question is solved.