require()
function and no need to install the module using NPM because the http module is the core module of Node.js.
The method createServer()
of the http is used to call the specific callback function with the request and response parameters.
The method listen()
of server object is to be used and is returned from the createServer()
method with the given port number i.e. if the given port number is 8080 then the incoming request would be on port 8080. Finally in this way one can create a web server using this simple process.