[Node.js 101] 1. Getting started

[ What is Node.js? ]

[ ‘Hello World!’ in a Command Prompt ]

console.log("Hello World!")
node index.js

[ ‘Hello World!’ in a HTTP Server ]

var http = require("http");
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('\nHello World!\n');
}).listen(8081);
console.log('Server running at http://127.0.0.1:8081/');
node server.js

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store