diff --git a/hello_world_node.js b/hello_world_node.js new file mode 100644 index 0000000000000000000000000000000000000000..e564323ce3950e772832876da88286e1d4d8b176 --- /dev/null +++ b/hello_world_node.js @@ -0,0 +1,15 @@ +var http = require("http"); + +http.createServer(function (request, response) { + + // Send the HTTP header + // HTTP Status: 200 : OK + // Content Type: text/plain + response.writeHead(200, {'Content-Type': 'text/plain'}); + + // Send the response body as "Hello World" + response.end('Hello World\n'); +}).listen(8081); + +// Console will print the message +console.log('Server running at http://127.0.0.1:8081/');