Skip to main content

Create Hello World program using Node.js.

About Node.js?


Node.js is an open source, cross-platform runtime environment for developing server-side and networking applications. Node.js applications are written in JavaScript, and can be run within the Node.js runtime on OS X, Microsoft Windows, and Linux.

 Code:

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.end('Hello World!');
}).listen(8080);



 Command For Run:

  C:\Users\Soham Upadeo\>cd desktop

  C:\Users\Soham Upadeo\node simple.js
Output :

Comments