From 1b497f3ff17a1c6930b9b640f7ec708a07363a17 Mon Sep 17 00:00:00 2001 From: Thrasyvoulos Karydis <thrasyvoulos.karydis@cba.mit.edu> Date: Thu, 12 Oct 2017 14:48:04 -0400 Subject: [PATCH] Add new file --- hello_world_node.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 hello_world_node.js diff --git a/hello_world_node.js b/hello_world_node.js new file mode 100644 index 0000000..e564323 --- /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/'); -- GitLab