N Klosterman
N Klosterman

Reputation: 1251

What is the difference between Express 3/4 and Express Framework?

Going through the socket.io documentation I discovered that there is express v.3/4 and express framework. What is the difference?

Upvotes: 27

Views: 6932

Answers (2)

josh3736
josh3736

Reputation: 144912

In the context of the socket.io docs, "Express Framework" means Express 2.x.

There were a number of breaking API changes between Express 2 and Express 3. The code to use socket.io with these versions is different, which is why they are listed separately.

(This is so labeled because Express 2 was the only version in wide use when socket.io first came out. When v3 came out, a section was added noting the difference in API, but the original section wasn't renamed. Now, the terminology is just confusing. Issue filed.)


The following is what I posted originally, when I thought the question was asking about the difference between Express 3 and 4. Since this question is a top Google result for "difference between express 3 and 4", I'm going to leave it here.

The difference between Express 3 and 4 is fully documented in the Express Wiki.

The biggest change is that connect is no longer a dependency, and therefore many previously included middleware functions are no longer in the box. This means things like bodyParser are now obtained separately.

Additionally, app.router no longer exists, which means app.get etc and app.use are now processed in the exact order you add them.

Upvotes: 24

Ryan
Ryan

Reputation: 14649

The biggest difference is not packing any of the connect modules in the box. Every module like express.logger(), express.methodOverride(), express.responseTime() is a distinct package maintained separate from the express.js pacakage.

Upvotes: 3

Related Questions