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

import { serve } from '@hono/node-server';
import { AgentBase, AgentServer } from '@signalwire/sdk';
const agent = new AgentBase({ name: 'support', route: '/support' });
agent.setPromptText('You are a helpful assistant.');
const server = new AgentServer();
server.register(agent);
const app = server.getApp();
serve({ fetch: app.fetch, port: 8080 });