Express is a fast, unopinionated, minimalist web framework for Node.js. It provides the routing, middleware, and HTTP helper layer that most Node.js web servers and APIs are built on, without dictating how you structure your app, which ORM you use, or which template engine you render with. It's aimed at Node.js developers building anything from a small public API to a full server-rendered web application, who want a thin, well-understood layer over Node's HTTP module rather than a heavier, more opinionated framework.
@ladjs/consolidate, without forcing you into any one of them.express-generator executable scaffolds a new application structure quickly from the command line.Express fits building HTTP APIs, single-page application backends, traditional server-rendered websites, and hybrid apps that mix both, especially when you want control over your stack rather than a framework that bundles in an ORM, a specific project structure, or a particular auth system by default. Its unopinionated design also makes it a common building block underneath higher-level frameworks and generators, rather than a rigid endpoint in itself.
It's less suited to teams that specifically want a batteries-included framework with conventions baked in for things like database access, file structure, or authentication out of the box. Because Express deliberately avoids forcing an ORM or template engine choice, teams that want less decision-making up front may find a more opinionated framework built on top of Express (or an alternative like NestJS) a better starting point than raw Express itself.
Anyone upgrading an existing app should read the dedicated migration guide before moving to the current major version, since routing and middleware behavior have changed enough between versions to affect existing code. Security issues should be reported through the project's documented security policy rather than as a public issue, and general development and usage questions have a dedicated space in GitHub Discussions separate from the issue tracker.
Express requires Node.js 18 or higher. If starting a new project, create a package.json first:
npm init
Then install Express:
npm install express
A minimal server looks like this:
import express from 'express'
const app = express()
app.get('/', (req, res) => {
res.send('Hello World')
})
app.listen(3000, () => {
console.log('Server is running on http://localhost:3000')
})
To scaffold a new application quickly instead of starting from scratch, install the generator (matching Express's major version) and run it:
npm install -g express-generator@4
express /tmp/foo && cd /tmp/foo
npm install
npm start
To run the included examples, clone the repository directly and run individual example files:
git clone https://github.com/expressjs/express.git --depth 1 && cd express
npm install
node examples/content-negotiation
Running the framework's own test suite requires installing dependencies first, then running npm test.