Skip to main content

NestJS

Dhal does not need a dedicated NestJS adapter because NestJS usually runs on Express or Fastify.

NestJS with Express

import { NestFactory } from "@nestjs/core";
import { AppModule } from "./app.module";
import { dhal } from "@rokadhq/dhal/express";

const app = await NestFactory.create(AppModule);

app.use(dhal());

await app.listen(3000);

NestJS with Fastify

Use the Fastify adapter where your Nest app exposes the underlying Fastify instance/plugin flow.

import { dhalFastify } from "@rokadhq/dhal/fastify";

Recommendation

For NestJS, start with monitor mode and route-level policy for auth and upload endpoints.