* feat: Introduce WebSocket helper for Node.js | `@hono/node-ws` * feat(node-ws): add ci and build command * chore: update yarn.lock * update `yarn.lock` * fixed the ci config * add `@hono/node-server` to devDependecies * fixed format and specify node version * fix(node-ws/docs): fix example * feat: `upgradeWebSocket` be named function --------- Co-authored-by: Yusuke Wada <yusuke@kamawada.com> |
||
---|---|---|
.. | ||
src | ||
README.md | ||
package.json | ||
tsconfig.json | ||
vitest.config.ts |
README.md
WebSocket helper for Node.js
A WebSocket helper for Node.js
Usage
import { createNodeWebSocket } from '@hono/node-ws'
import { Hono } from 'hono'
import { serve } from '@hono/node-server'
const app = new Hono()
const { injectWebSocket, upgradeWebSocket } = createNodeWebSocket({ app })
app.get('/ws', upgradeWebSocket((c) => ({
// https://hono.dev/helpers/websocket
})))
const server = serve(app)
injectWebSocket(server)
Author
Shotaro Nakamura https://github.com/nakasyou
License
MIT