How to Create http module to transfer data over the Hyper Text Transfer Protocol?

Here, we will write a program to create http module to transfer data over the hyper text transfer protocol.

app.js file

var http=require('http');
http.createServer(function(req,res){
    res.write('Sending this text to Hyper Text Transfer Protocol at port no 4000');
    res.end();
}).listen(4000)