Express Hello World

First Node js Express Hello world example:

// Include the Express module

Var express = require ('express');

// Create an instance of Express

var app = express ();

// A route for the home page

app.get('/', function(req,res){

res.send('<h1>Hello</h1> Express');    // Sends an HTTP response object,with an optional HTTP response code


// Start the app

var server = app.listen(3000,function(){

console.log('Listening on port 3000');


My Name is Dileep Singh, Noder, Javascript Lover & NoSql Developer, Fitness Freak, Love to travel new places, learning photography & Music Manic ♯ ♩ ♬

Posted in Node.Js Tagged with: ,