What is the technical difference between express and http, and put together in this regard

var express = require("express")
  , app = express()
  , http = require("http").createServer(app)

I constantly see how they get addicted. In my opinion, http hosts front-end html? and the expression contains the server-sided nodejs logic? and the connection was an express base layer, so is it also a server module?

If it’s not, why people just don’t

express().listen(8080)

instead

require("http").createServer(express()).listen(8080)
+4
source share
1 answer

Express- This is another layer on top http. It performs the basic repetitive tasks required for a web application. connectIt is a middleware that also performs the basic repetitive tasks needed for a web application.

, , , , . - , , cookie. Express .

Express 4.x , body-parser, morgan .. , . , Express - GitHub .

Express - http Express http. , http. Express, , http. , https://github.com/strongloop/express/blob/master/lib/application.js#L540-543

+7

All Articles