getApp

View as MarkdownOpen in Claude

Build and return the Hono application with all registered agents and a root listing endpoint. If no agent is mounted at /, the root returns a JSON listing of all registered agents.

Parameters

None.

Returns

Hono — The fully configured Hono app.

Example

1import { serve } from '@hono/node-server';
2import { AgentBase, AgentServer } from '@signalwire/sdk';
3
4const agent = new AgentBase({ name: 'support', route: '/support' });
5agent.setPromptText('You are a helpful assistant.');
6
7const server = new AgentServer();
8server.register(agent);
9
10const app = server.getApp();
11serve({ fetch: app.fetch, port: 8080 });