How to create node JS Server,
1.) Node.js has a built-in module called HTTP, which allows Node.js to transfer data over the Hyper Text Transfer Protocol (HTTP).
2.) To include the HTTP module, use the require() method:
var http = require('http'); 3.) Node.js as a Web Server The HTTP module can create an HTTP server that listens to server ports and gives a response back to the client.
4.) Use the createServer() method to create an HTTP server: