mount
Mount another Hono app, or a fetch handler, alongside this agent’s routes. Use
it instead of adding routes to the app from getApp() by hand: the
agent rebuilds its app when its routes change (when you register a routing
callback, for example), and a mount is replayed on every build.
A mounted app answers its own CORS preflights, since the agent’s CORS and CSRF
middleware don’t apply to it. It also sets its own security headers and isn’t
behind the agent’s basic auth. Mount before calling serve().
Parameters
appOrRouter
A Hono app, whose routes are added under prefix, or a fetch handler, which is
mounted at prefix and doesn’t see it.
opts
Mount options.
opts.prefix
Path to mount at, from the host root. A trailing slash is dropped. Defaults to the root.
opts.name
Accepted so code written for the Python SDK works. It has no effect.
Returns
AgentBase — Returns this for method chaining.
Example
See ChatGateway for what the mounted router serves.