NodeJs Hello World Project

HelloWorld Example 

main.js

/**
* nodeJS is JavaScript-based framework/platform built on Google Chrome V8 Engine.
* It is used to develop I/O intensive web application 
* like video streaming sites, sigle-page application. 
*/
var http = require("http");
http.createServer(function(request, response){
 response.writeHead(200, {'Content-Type': 'text/plain'});
 response.end('Hello World\n');
}).listen(8080);
console.log("Server is running on http://localhost:8080/");

Command to start server

node main.js

 

NPM Install Proxy

Proxy Configuration NPM Command

Npm Command to set proxy configuration.

npm config set proxy http://login:pass@host:port
npm config set https-proxy http://login:pass@host:port
npm config set http-proxy http://login:pass@host:port
npm config set registry "http://registry.npmjs.org/"
npm config set strict-ssl false

The configuration is stored in <User Folder>/.npmrc

.npmrc

proxy = http://login:pass@host:port
https-proxy = http://login:pass@host:port
strict-ssl = false
http_proxy = http://login:pass@host:port
registry = http://registry.npmjs.org/