Going through the socket.io documentation I discovered that there is express v.3/4 and express framework. What is the difference?
Express is a node js web application framework that provides broad features for building web and mobile applications. It is used to build a single page, multipage, and hybrid web application. It's a layer built on the top of the Node js that helps manage servers and routes.
Introducing Express Express is the most popular Node web framework, and is the underlying library for a number of other popular Node web frameworks. It provides mechanisms to: Write handlers for requests with different HTTP verbs at different URL paths (routes).
Express is a routing and middleware web framework that has minimal functionality of its own: An Express application is essentially a series of middleware function calls.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With