MCPcopy Create free account
hub / github.com/honojs/node-server / startServer

Function startServer

test/websocket.test.ts:7–17  ·  view source on GitHub ↗
(app: Hono)

Source from the content-addressed store, hash-verified

5
6describe('WebSocket', () => {
7 const startServer = (app: Hono) => {
8 const wss = new WebSocketServer({ noServer: true })
9 const server = createAdaptorServer({ fetch: app.fetch, websocket: { server: wss } })
10 return new Promise<{ server: ReturnType<typeof createAdaptorServer>; address: AddressInfo }>(
11 (resolve) => {
12 server.listen(0, () => {
13 resolve({ server, address: server.address() as AddressInfo })
14 })
15 }
16 )
17 }
18
19 it('should connect with upgradeWebSocket without manual injection', async () => {
20 const app = new Hono()

Callers 1

websocket.test.tsFile · 0.85

Calls 1

createAdaptorServerFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…