Skip to main content
Express and other major Node.js HTTP libraries work with Bun out of the box. Bun implements the node:http and node:https modules that Express relies on.
See the Node.js compatibility page for detailed information about which Node.js APIs Bun supports.

Setup

1

Install Express

2

Create a server

src/server.ts
3

Run the server

Routing

Express routing works identically on Bun:

Middleware

Express middleware functions work the same way:

Performance notes

Express on Bun is faster than Express on Node.js because Bun’s HTTP implementation is more efficient. However, if you are starting a new project and do not need Express compatibility, Bun’s native Bun.serve() API or a Bun-native framework like Elysia or Hono will provide better performance.
Most Express middleware from the npm ecosystem (body-parser, helmet, morgan, cors, etc.) works with Bun without any changes.