DevAcademy
LearnNode.jsExpress Introduction
IntermediateNode.js

Express Introduction

Meet Express, the most widely used web framework for Node.js.

Reading Time

10 min

Lesson

Lesson 18 of 34

Why Express?

Express is a minimal, unopinionated web framework that sits on top of the http module, adding routing, middleware, and convenient request/response helpers — replacing all the manual boilerplate seen in the previous lessons.

Installing and Starting an Express App

npm install express

A Minimal Express Server

Try it yourself — edit and run

Console Output

Click “Run” to see the console output here.

Express vs Raw http

Raw httpExpress
Manual req.url/req.method checksapp.get(), app.post(), etc. with path patterns
Manual body stream readingexpress.json() middleware parses it automatically
No built-in middleware conceptA rich middleware ecosystem for logging, auth, CORS, etc.

res Helper Methods

Try it yourself — edit and run

Console Output

Click “Run” to see the console output here.

"Unopinionated" by Design

Unlike some frameworks (NestJS, Rails), Express doesn't enforce a particular project structure, ORM, or architecture — it gives you routing and middleware primitives, and you (or your team's conventions) decide everything else.

Best Practice

Even experienced Node.js developers rarely write raw http servers day-to-day — Express (or a similar framework) is the practical default for building APIs, precisely because it eliminates so much repetitive boilerplate.

Interview Questions

Quick Quiz

1. What is Express built on top of?

2. What does res.json({ users: [] }) do?

3. What does "unopinionated" mean about Express?