Express
Understand the role of Express in building server-side applications with Node.js. Explore how Express manages HTTP requests using routing and middleware, and why it is the preferred framework for backend JavaScript development.
We'll cover the following...
Previously, we discussed Node.js and its core features. Now, let’s talk about Express and see why it might be worth using, even if Node.js already does everything we need.
Express is an open-source, fast, minimalist, and unopinionated Node.js framework. It adds more functionality to Node.js through the provision of middleware and routing (we’ll discuss these terms at length soon). Express has rapidly become the most widely-used, standard server framework for Node.js.
Here’s a detailed breakdown of the HTTP request flow in Express that’s detailed in the above illustration:
- The client requests something. A client can request server resources through the
HTTPprotocol, which is the main communication method in most web applications. - The
HTTP