What do we mean by minimal yet flexible and powerful?
Express is minimal because it does not come loaded with all sorts of functionality, which makes it a bloat-free framework. Out of the box, it supports only the very basic features of a web framework. Even the supported features are not all enabled by default, you have the option to pick and use, according to your needs.
Express is a powerful framework because it gives you complete access to the core Node APIs. Anything you can do with Node, you can do it with Express too.
Express can be used to create very simple to very complex web apps. It provides you all the tools required to create the most complex of apps, but does not force you to use them when you don't need them.
Hearing someone tell you that Express is a minimal, flexible, and powerful web development framework doesn't really help much in understanding it, does it?. Many other frameworks probably claim the same thing. Let's find out what is actually special about Express.
Node was very well received by the web development community, and it started to grow very rapidly in popularity.
However, there was a problem with Node's web server API: It was a little too low level, and you had to write and re-write many of the web server functions in your web apps. Modularity and extensibility became a problem for any project that was even moderately big.
Within five months of Node's release, in June 2009, T.J. Holowaychuk, released an open source project named Express to make web development a little easier in Node.
Express was inspired by Ruby's Sinatra and built on top of Node's web server API. It was a little crude, but provided some of the niceties—such as a routing system, session and cookie support, MIME helpers, RESTful interface, HAML-based views, and so on—one might expect from a web development framework.
However, Express v0.0.1 was very different from what Express 3 is today. Perhaps, the only thing common in between them is the name "Express".
In June 2010, Sencha, under its Sencha Labs, started an open source project named Connect, to solve the modularity and extensibility issue in the Node web server API. The project was inspired by Ruby's Rack web server interface. Tim Caswell, a Sencha employee, and T.J. Holowaychuk, were roped in to lead the project.
Like Express, Connect was also built on top of Node's web server API, and came with a middleware system, which allowed small re-usable programs to be plugged onto it to handle HTTP-specific functionalities.
Connect middlewares took care of many of the commonly required functionalities in web apps for Node. On top of that, anyone could write their own middleware for their apps. Connect considerably improved the modularity and extensibility of the Node web server API.
By now, there were two different web development frameworks for Node: Express and Connect—one was inspired by Sinatra, and the other by Rack. This caused a bit of confusion in the Node community, especially with Holowaychuk working on both of them.
But as luck would have it, it became obvious that Express and Connect were actually complementary frameworks. So, in July 2010, Holowaychuk decided to re-architect Express to run on top of Connect, effectively merging Connect with Express to create a new incarnation of Express in v1.0.0.
With Express v1.0.0, there was no more confusion about which web development framework to choose in Node. Express was Connect with additional functionalities built on top of it. To this day it remains the same—Express continues to use the Connect middleware, and any change in Connect is invariably reflected in Express.
So, that is the story of how Express came into being and how Connect is related to it.
As an Express developer, you might rarely deal with Connect directly, but you will be using a lot of middlewares in your projects. Middlewares in Express are referred to as Express middlewares and not Connect middlewares, although technically they are Connect middlewares. You will learn more about middlewares in upcoming sections in this and the next chapter.