Example create hello world use express

Express is a minimal and flexible Node.js web application framework that provides a robust set of features to develop web and mobile applications. It facilitates the rapid development of Node based Web applications.

Install express and modules working with express

1. body-parser − This is a node.js middleware for handling JSON, Raw, Text and URL encoded form data.

2. cookie-parser − Parse Cookie header and populate req.cookies with an object keyed by the cookie names.

3. multer − This is a node.js middleware for handling multipart/form-data.


C:\Nodejs>npm install express

C:\Nodejs>npm install body-parser

C:\Nodejs>npm install cookie-parser

C:\Nodejs>npm install multer


Example : create server with express


var express = require('express');

var app = express();

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

   res.send('Hello World');


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

   var host = server.address().address;

   var port = server.address().port;


   console.log("Server listening at http://%s:%s", host, port);



Run :


C:\Nodejs>node express_helloworld.js

Server listening at http://:::8080


Go browser go http://localhost:8080/


Hello world