NodeJS Series #4: Creating a Port Listener

Hello Wizards, First of all,sorry I couldn’t publish this post as I promised,i had illness.Even Wizards get sick! The purpose of this post is all about creating a server,listening it through a port number and then sending output to the browser. So lets start immediately! We shall write a small script that creates server and listens to this object. [sourcecode language=”javascript”] var http = require("http"); http.createServer(function (request, response) { response.writeHead(200, { "Content-Type": "text/plain" }); response.write("Listening to localhost:8888"); response.end(); }).listen(8888); [/sourcecode] Lets take a breath and talk about what this script does in…

Read More