why use http.createSever in express app?

I found in express api documentation, this is how one creates new express server

var express = require('express');
var app = express();

app.listen(3000);

it works properly but when you create a new app using express by default it generate following code to create new server

 var express = require('express');
 var app = express();
    http.createServer(app).listen(app.get('port'), function(){
      console.log("Express server listening on port " + app.get('port'));
    });

can someone explain me why express using http createServer method here.

The thing is that Express uses Node's http module on it's core and that's why you craete your Express application like that.

Check this for more info.

What is Node.js' Connect, Express and "middleware"?