DEV Community

Cover image for What is Express, really?
Neel-Vekariya
Neel-Vekariya

Posted on

What is Express, really?

What is Express, really?

In my last blog, I shared some of my personal experience and the thinking that led me from “How?” to “Why?”

So, I’m going to assume you already know the “how” of Express.

Now, let’s start understanding the “why” behind Express.

First, let’s understand what Express really is.

As per the technical definition:

Express.js is a minimal, unopinionated web application framework for Node.js that provides abstractions and APIs for handling HTTP requests, generating HTTP responses, routing, middleware composition, and building web/API applications.

🤦‍♂️🤦‍♂️ Very technical, right?

Don’t worry, I’ll explain it to you.

In simple terms, Express.js is a web application framework that provides the bare minimum (small set of core abstractions) tools to build your applications while giving you maximum freedom in how you structure your application.

It does not force you to follow a specific file structure.

It provides tools for handling requests, responses, routing, and other application tasks instead of making you manually handle those lower-level tasks.

Now you get the idea of what Express is.

But another confusing phrase came up:

“Lower-level application tasks.”

What does that actually mean?

To understand this, you first need to understand what problem Express is solving.

And that is another big topic, which we’ll discuss in the next post.

For now, assume there are some repeated tasks involved in building and setting up HTTP APIs.

Express handles many of these tasks under the hood.

This provides a layer of abstraction over those difficult tasks and gives developers a convenient way to work with:

1. Routing:

Deciding which code should handle a particular URL and HTTP method.

2. Middleware:

Creating a pipeline of functions that process requests and responses.

3. Request Handling:

Handling parameters, headers, and request bodies.

4. Response Handling:

Sending JSON, HTML, status codes, and other data.

5. Error Handling:

Handling errors consistently within the application.


But this brings us to another question:

What problem was Express actually trying to solve?

That’s what we’ll understand in the next blog.

Top comments (0)