I am new in NodeJS, I want to create a simple http server, Just send a 'Hello World' back to the client. I did something. If anyone, can check out my code if I did it right, if not add yours, I will be really appreciated.
Here is my code.
var http = require("http");
var server = http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/html"});
response.write("<html>");
response.write("<head>");
response.write("<title>Hello World!");
response.write("</head>");
response.write("<body>");
response.write("Hello World!");
response.write("</body>");
response.write("</html>");
response.end();
});
server.listen(80);
console.log("The Server is listening now...");