Skip to content

Node JS

Sandesh Kota edited this page Nov 27, 2019 · 56 revisions
  • A javascript runtime environment that executes the Javascript code outside of a browser. It can run on various platforms (Windows, Linux, Unix, Mac OS X, etc..)

Basic

  • Save the below code in a "firstNode.js" file
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.end('Hello World!');
}).listen(8080);
d:\> node firstNode.js

Clone this wiki locally