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
| Check | Why |
|---|---|
| Body limits configured | Avoid unbounded JSON requests |
| Error handler installed | Keep provider errors out of response bodies |
| Stream proxy behavior tested | NDJSON needs incremental flushing |
| Tracing connected | Tool and provider runs need observability |
Next
Debug common failures in Troubleshooting. Add telemetry with Observability.
