***

title: asRouter
slug: /reference/typescript/agents/agent-base/as-router
description: Get the agent's Hono app for mounting as a sub-router.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[agentserver]: /docs/server-sdks/reference/typescript/agents/agent-server

Get this agent's Hono application for mounting as a sub-router in a larger Hono
application or an [`AgentServer`][agentserver].

## **Parameters**

None.

## **Returns**

`Hono` -- A Hono app with all agent endpoints (SWML delivery, SWAIG function
handling, post-prompt, debug events, health checks, etc.).

## **Example**

```typescript {9}
import { Hono } from 'hono';
import { AgentBase } from '@signalwire/sdk';

const app = new Hono();

const supportAgent = new AgentBase({ name: 'support', route: '/support' });
const salesAgent = new AgentBase({ name: 'sales', route: '/sales' });

app.route('/support', supportAgent.asRouter());
app.route('/sales', salesAgent.asRouter());
```