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

CheckWhy
express.json limit setAvoid unbounded body parsing
Error middleware installedAvoid leaking provider stack traces
Proxy buffering disabledNDJSON streams must flush incrementally
Observability enabledTool and provider failures need traces

Next

Debug common failures in Troubleshooting. Add telemetry with Observability.