Express
07 Deploy
Deploy Express Anvia routes in a Node runtime.
Express runs in Node. Size timeouts, body limits, and proxy buffering for model calls and streams.
1. Start The Server
import { app } from "./app";
const port = Number(process.env.PORT ?? 3000);
app.listen(port, () => {
console.log(`listening on :${port}`);
});2. Configure Environment Variables
OPENAI_API_KEY=sk_...
DATABASE_URL=...
ANVIA_STUDIO_TOKEN=...Keep provider keys server-side and inject them through your deployment platform.
3. Streaming Checks
Disable buffering in reverse proxies for /api/support/stream. Keep Node and proxy timeouts longer than expected agent runs.
4. Production Checklist
| Check | Why |
|---|---|
express.json limit set | Avoid unbounded body parsing |
| Error middleware installed | Avoid leaking provider stack traces |
| Proxy buffering disabled | NDJSON streams must flush incrementally |
| Observability enabled | Tool and provider failures need traces |
Next
Debug common failures in Troubleshooting. Add telemetry with Observability.
