Fastify

07 Deploy

Deploy Fastify Anvia routes in a Node runtime.

Fastify is a good fit for long-lived Node services. Configure timeouts and stream behavior explicitly.

1. Start The Server

import { app } from "./app";

const port = Number(process.env.PORT ?? 3000);

await app.listen({ host: "0.0.0.0", port });

2. Configure Environment Variables

OPENAI_API_KEY=sk_...
DATABASE_URL=...
ANVIA_STUDIO_TOKEN=...

3. Streaming Checks

Confirm application/x-ndjson responses flush through your proxy and hosting layer.

4. Production Checklist

CheckWhy
Body limits configuredAvoid unbounded JSON requests
Error handler installedKeep provider errors out of response bodies
Stream proxy behavior testedNDJSON needs incremental flushing
Tracing connectedTool and provider runs need observability

Next

Debug common failures in Troubleshooting. Add telemetry with Observability.