I have written the following create server code in node.js:
var http = require("http");
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end("Howdy");
}).listen(8081);
console.log("server running on port 8081");
This worked well and I got the response rendered on browser when run on localhost. Because HTTP status 200 means OK request (a successful HTTP request), i tried with 404, by editing line 4 to:
response.writeHead(404, {'Content-Type': 'text/plain'});
But I still got the same response on the browser as with http status 200. Because 404 shall send "Page not found" type of notification , I want to know if there is any problem in my code or http server configuration, or browser?