Hello Readers.
Node.js is very popular in market in creating of real time applications.Here's the example of how we can create the server in our local system to run the Node.js applications.
var http = require('http')
, static = require('node-static')
, server;
// since socket.io 0.7 consumes one socket we need another socket to transmit all static files from ./public dir
server = http.createServer(function(req, res){
req.addListener('end', function () {
file.serve(req, res);
}).resume();
}).listen(8081);
where 8081 is the port number to run the application.
0 Comment(s)