I am learning express and I have seen 2 different ways of creating a server. Just curious on what's the difference between the 2 methods. Here's an express server done as in most tutorials:
var express = require('express');
var app = express();
app.listen(3000, function () {
console.log('Example app listening on port 3000.');
});
and the second way I found, using http server.
var express = require('express');
var app = express();
var http = require('http');
var httpServer = http.createServer(app);
httpServer.listen(3000);
Why and when would I use one over the other? Does it make a big difference?
Thank you