Adapters & runtimes
DaloyJS is a REST API backend framework. The core only ever sees Request → Response. Runtime-specific concerns, sockets, signals, edge handlers, Lambda event shapes, live in thin adapters at the edge. Choose the adapter for the place you want to deploy your API.
Pick a target
Runtimes (you own the process)
Edge & serverless (platform owns the process)
Containers on Google Cloud Run, Fly.io, Render, Railway, or Kubernetes use the Node adapter. See Deployment.
What each adapter gives you
Every adapter runs the same routing, validation, security headers, and problem+json errors. What differs is what the platform hands the adapter:
| Adapter | Real client peer | Streaming responses | WebSockets (app.ws) | Graceful shutdown | OTLP telemetry flush |
|---|---|---|---|---|---|
Node (/node) | Yes, from the socket | Yes | Yes | SIGTERM/SIGINT | Interval + on shutdown |
Bun (/bun) | Yes, from the socket | Yes | Yes | SIGTERM/SIGINT | Interval + on shutdown |
Deno (/deno) | Yes, from the socket | Yes | No | SIGTERM/SIGINT | Interval + on shutdown |
Cloudflare Workers, workerd (/cloudflare) | No, use behindProxy | Yes | No | Platform-managed | Per request via ctx.waitUntil |
Vercel (/vercel) | No, use behindProxy | Yes | No | Platform-managed | Per request via waitUntil when present |
Netlify v2 / Edge (/netlify) | Yes, from context.ip | Yes | No | Platform-managed | Per request via context.waitUntil |
Fastly Compute (/fastly) | No, use behindProxy | Yes | No | Platform-managed | Per request via event.waitUntil |
AWS Lambda (/lambda) | Yes, from the event | Buffered, or toLambdaStreamHandler | No | Platform-managed | Awaited before returning |
Azure Functions (/azure) | No, use behindProxy | Buffered, or stream: true | No | Platform-managed | Awaited before returning |
- Real client peer is what
getConnInfo(ctx.request)returns. It never comes from a header a client could fake. Where the platform does not expose it, declarebehindProxysorateLimit()andresolveClientIp()read the platform'sX-Forwarded-For. See Reverse proxy. - Graceful shutdown means the adapter drains your
app.onShutdownhooks on a signal. On platform-managed hosts your code is never sentSIGTERM, so do not rely on shutdown hooks there.
The Node adapter runs the whole test suite. Deno, Bun, and workerd also run a smoke suite on the real runtime binaries in CI, against the published dist/ build, on every change.
Roll your own
If your runtime exposes the web-standard Request / Response contract and isn't listed above, you don't need an adapter at all, pass the incoming request straight to app.fetch:
See also
- Deployment: Docker, reverse proxies, health checks, and platform guides (Fly.io, Render, Railway, Heroku, Google Cloud Run).
- Scaffolder:
pnpm create daloyships runtime-specific templates.