Skip to content

API reference / @chanx-js/server / hono / chanxHono

Function: chanxHono() ​

ts
function chanxHono(chanx, upgradeWebSocket): MiddlewareHandler;

Defined in: packages/server/src/adapters/hono.ts:22

Hono middleware serving chanx, on any runtime: pass the runtime's upgradeWebSocket (from hono/bun, hono/deno, hono/cloudflare-workers or @hono/node-ws). Requests for paths no consumer serves go on to the next handler.

ts
app.get('/ws/*', chanxHono(chanx, upgradeWebSocket));

Parameters ​

ParameterType
chanxChanx
upgradeWebSocketUpgradeWebSocket

Returns ​

MiddlewareHandler

MIT licensed