From f4cd09a687d351bec835c39a5120e79a11a14037 Mon Sep 17 00:00:00 2001 From: Conor Mullin Date: Mon, 1 Oct 2018 15:26:33 +0100 Subject: [PATCH] Hello World via Node.JS server. Start using 'node helloworld.js' --- easterncalculus/helloworld.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 easterncalculus/helloworld.js diff --git a/easterncalculus/helloworld.js b/easterncalculus/helloworld.js new file mode 100644 index 0000000..2b85f58 --- /dev/null +++ b/easterncalculus/helloworld.js @@ -0,0 +1,13 @@ +const http = require('http'); +const hostname = '127.0.0.1'; +const port = 12345; + +const server = http.createServer((req, res) => { + res.statusCode = 200; + res.setHeader('Content-Type', 'text/plain'); + res.end('Hello World!'); +}); + +server.listen(port, hostname, () => { + console.log(`Server running. Please check: http://${hostname}:${port}/`); +}); \ No newline at end of file