import { createAgentRouter } from "@radaros/transport";
import { createGatewayRouter } from "@radaros/transport";
import express from "express";
const app = express();
app.use(express.json());
// Local agents are served normally
app.use("/api", createAgentRouter({ cors: true }));
// Gateway routes to remote endpoints
app.use("/api", createGatewayRouter({
remotes: [
{
baseUrl: "https://us-east.api.example.com",
agents: ["analyst", "researcher"],
teams: ["research-team"],
},
{
baseUrl: "https://eu-west.api.example.com",
agents: ["translator"],
workflows: ["translation-pipeline"],
headers: { Authorization: "Bearer eu-token" },
},
],
healthCheckIntervalMs: 30_000,
}));
app.listen(3000);