var http = require('http');
var server = http.createServer(function (req,res){
console.log(req.url);
res.writeHead(200,{'Content-Type':'text/html'});
res.write('<h1>Node.js</h1>');
res.end('<p>end.</p>');
});
server.listen(3000);
server.on('close',function (){
console.log('server is closed.');
});
console.log('http server is listening at port 3000.');
var server = http.createServer(function (req,res){
console.log(req.url);
res.writeHead(200,{'Content-Type':'text/html'});
res.write('<h1>Node.js</h1>');
res.end('<p>end.</p>');
});
server.listen(3000);
server.on('close',function (){
console.log('server is closed.');
});
console.log('http server is listening at port 3000.');