its very simple, node already provides a fs module from which u can read this html file and add obj to the response as follows:
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 that you only get the HTML document and not the resources inside the HTML files that are stored in different folders, for example, if you have this code in your index.html
<link rel="stylesheet" href="../css/index.css" />
this index.css will not be resolved by the node server. But I think your question is resolved.
source share