---
title: "Use Express for a Node.js server · Agent Wranglers"
url: https://agentwranglers.se/playbook/stack/web-frameworks/express
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Use Express for a Node.js server

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

For AI agents: [llms.txt](https://agentwranglers.se/llms.txt) is a short guide that sends you to the rules your problem needs, and [rules.json](https://agentwranglers.se/playbook/stack/rules.json) holds every rule of this playbook as JSON.

- Level: Recommended
- Chapter: [Web frameworks](https://agentwranglers.se/playbook/stack/web-frameworks)
- Rule: Use Express 5 for HTTP servers and APIs in Node.js.
- Cost: Open source. MIT licence, free to run on your own servers.
- How: Express 1.0 came out in December 2010, and version 5.3.0 shipped in October 2026. The Express support page lists 5.x as supported since September 2024. It is the most used Node server framework in the 2026 Stack Overflow survey, at 15.6%, with about 87 million weekly downloads. It is MIT licensed and run under the OpenJS Foundation. Express 5 passes errors from async handlers to the error handler by itself. Choose something else when throughput is the main limit. Fastify passes the tests, with 1.0 in March 2018, 5.12.7 in October 2026 and 9 million weekly downloads. Choose NestJS when a large team wants a fixed module structure, and stay on 11 until 12 is six months old. Check every request body, as [Use Zod or Pydantic to check every input](https://agentwranglers.se/playbook/stack/web-frameworks/zod-pydantic) says.
- Check: package.json lists express at major version 5 or higher, and no route file wraps async handlers in a try and catch only to call next.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
import express from 'express';

const app = express();
app.use(express.json({ limit: '100kb' }));
app.get('/orders/:id', async (req, res) => res.json(await findOrder(req.params.id)));
app.listen(3000);
```

### Python example

```python
import json

def express_major(package_json: str) -> int:
    version = json.load(open(package_json))["dependencies"]["express"]
    return int(version.lstrip("^~").split(".")[0])

assert express_major("package.json") >= 5
```

## Sources

- [Express](https://expressjs.com/)
- [Express version support](https://expressjs.com/en/support/)

## Related rules

- [Use Zod or Pydantic to check every input](https://agentwranglers.se/playbook/stack/web-frameworks/zod-pydantic) in Software choices

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/stack/web-frameworks/express">Agent Wranglers software choices playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Use Next.js when React pages need a server](https://agentwranglers.se/playbook/stack/web-frameworks/nextjs)
- Next: [Use Django for a Python web app](https://agentwranglers.se/playbook/stack/web-frameworks/django)
- [Web frameworks](https://agentwranglers.se/playbook/stack/web-frameworks)
