router
Returns a Hono app that serves POST /handoff, /escalate, and /say. Mount it at the same prefix
as the gateway’s router, because the browser derives all three paths from the
gateway’s URL.
Each route returns 403 for a refused origin. It returns 404 with { error: 'not found' } when
the nonce or handle doesn’t verify, and /escalate returns 400 with { error: 'bad request' }
when handle is missing. A body over 64 KiB is answered with 413 and
{ error: 'request too large' }, and /say text over 8 KiB with 413 and
{ error: 'message too large' }. Both are checked before the nonce is looked up.
Each route answers its own CORS preflight, and every answer carries CORS headers for an origin the gateway allows.
Parameters
None.
Returns
Hono — the app.