Skip to content

Getting started

Requires Bun 1.4 or newer (bun upgrade) and NestJS 12 or newer.

Terminal window
bun create @nestbun my-api --adapter bun
Terminal window
bun add @nestbun/platform

Then pass it to NestFactory.create(). This is the only code change:

src/main.ts
import { NestFactory } from '@nestjs/core';
import { BunAdapter, type NestBunApplication } from '@nestbun/platform';
import { AppModule } from './app.module.js';
const app = await NestFactory.create<NestBunApplication>(AppModule, new BunAdapter());
await app.listen(3000);

See Migrating from Express for the handful of things worth checking in a larger app.