Files
copilotkit__copilotkit/examples/v2/runtime/elysia/src/index.ts
Alem Tuzlak 68f9b8ad45 feat(examples): add runtime adapter examples for Express, Hono, Node, Deno, Elysia, and CF Workers
Example projects demonstrating the new fetch-based runtime adapters
across six server frameworks/runtimes.
2026-04-03 18:41:29 +02:00

24 lines
564 B
TypeScript

import { Elysia } from "elysia";
import {
CopilotRuntime,
createCopilotRuntimeHandler,
BuiltInAgent,
} from "@copilotkit/runtime/v2";
const runtime = new CopilotRuntime({
agents: {
default: new BuiltInAgent({ model: "openai/gpt-5-mini" }),
},
});
const handler = createCopilotRuntimeHandler({ runtime, cors: true });
const port = Number(process.env.PORT ?? 4004);
new Elysia()
.all("/api/copilotkit/*", ({ request }) => handler(request))
.listen(port);
console.log(
`Elysia runtime listening on http://localhost:${port}/api/copilotkit`,
);