Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dhal.rokad.co/llms.txt

Use this file to discover all available pages before exploring further.

Next.js

Dhal currently targets Node application runtimes such as Express, Fastify, and raw node:http. Use Dhal when your Next.js app is served through a custom Node server or when you have a backend service beside Next.js.
import express from "express";
import next from "next";
import { dhal } from "@rokadhq/dhal/express";

const app = next({ dev: process.env.NODE_ENV !== "production" });
const handle = app.getRequestHandler();

await app.prepare();

const server = express();
server.use(dhal());
server.all("*", (req, res) => handle(req, res));
server.listen(3000);

Edge runtime note

Dhal is app-native Node middleware. Edge runtimes based on Fetch-style handlers need a Fetch adapter. Treat that as future adapter work unless your app is running in a Node server process.