27
Sep
Download Node.js The official Node.js website has installation instructions for Node.js: https://nodejs.org Getting Started Once you have downloaded and installed Node.js on your computer, let's try to display "Hello World" in a web browser. Create a Node.js file named "myfirst.js", and add the following code: myfirst.js var http = require('http');http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.end('Hello World!'); }).listen(8080); Save the file on your computer: C:UsersYour Namemyfirst.js The code tells the computer to write "Hello World!" if anyone (e.g. a web browser) tries to access your computer on port 8080. For now, you do not have to understand the code.…