Skip to content

Instantly share code, notes, and snippets.

View BlankParticle's full-sized avatar
🏔️
Just being me

Rahul Mishra BlankParticle

🏔️
Just being me
View GitHub Profile
@BlankParticle
BlankParticle / Results.md
Created July 23, 2026 12:27
Comparisons of wildcards in different Hono routers
@BlankParticle
BlankParticle / nitro-websocket-response.ts
Last active March 20, 2026 11:02
Do Websockets easily with nitro
import type { WebSocketHooks } from "nitro/h3";
/**
* This is an exclusive nitro + crossws behavior.
* If you put a crossws property on a response, nitro will automatically pick that up and handle the websocket connection for you.
* See: https://github.com/nitrojs/nitro/blob/5d51b7f3f9f0ecf6c201f71b6a48aa7d2c1dd025/src/runtime/internal/app.ts#L78-L82
*
* This is a lightweight wrapper around the Response class for easier usage and type safety.
*/
export class NitroWebSocketResponse extends Response {