I am new to node.js and am trying to experiment with basic stuff.
My code is this
var http = require(\"http\"); http.createServer(function(request,
You can do this by handling the error event on the server you are creating. First, get the result of .createServer().
.createServer()
var server = http.createServer(function(request, response) {
Then, you can easily handle errors:
server.on('error', function (e) { // Handle your error here console.log(e); });