Showing posts with label node.js programs. Show all posts
Showing posts with label node.js programs. Show all posts

Friday, January 6, 2012

Create Server with Node js

We can create a full fledged SERVER in Node.js , we need HTTP server to handle all web requests and responses  and to serve web pages.

lets make a simple server,At first it seems like tough task to create server , but with node js its not 

  

var http = require("http");

http.createServer(function(request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.write("Hello World");
  response.end();
}).listen(8888);

That's it! You just wrote a working HTTP server. Let's prove it by running and testing it. First, execute your script with Node.js
require HTTP  its like include header files in c/c++.  it include the module called "http". Now In  http.createServer passing anonymous function (function with no name).  


Friday, December 30, 2011

node js

Hi This is my progress blog on Node.js . I have started learning Node.js . i must say Node.js is powerful Language to create servers .Thanx to Mr. Ryan Dahl. who is the creator or Node.js . Moreover You will find programs or small apps (server)  on this blog .


just a look at video .