crystal
crystal copied to clipboard
Hono adaptor
https://github.com/litewarp/graphile-tools/blob/main/packages/hono-adapter/src/adapter.ts
Hey! Saw you made this, so I'll ask questions here to keep things organized.
Question 1 - how important are the http major and minor versions? The Hono context object doesn't provide them like aws. I could wrap the server to extract it from the raw request but wasn't sure if it was worth the effort.
I don't think they're currently used for anything; but they could be in future - there are certain things that are different between HTTP/1.1 vs HTTP/2+, for example chunked transfer encoding is not supported in HTTP/2+.
I've used Koa for idk, 10 years? Would love to migrate to Hono. 👍
I've used Koa for idk, 10 years? Would love to migrate to Hono. 👍
As someone who recently switched from Express to Hono Bun I highly recommend it. It just feels like a leaner and streamlined version of Express. It has definitely sped up development for me.
Just an update. Bun should work fine with the original adapter I made above, but there is no http2 or grpc support until bun adopts that natively. It looks like there's work being done, so I'll revisit once it's complete -- https://github.com/oven-sh/bun/pull/14286
It was easy to write an adapter to use hono as the underlying http server, but adding websocket support for node is tricky since it involves the collab of multiple moving parts as seen in your bun adapter.
Every week I spend an hour trying to get it to work. 😅 If I can manage to migrate off Express, I'd shave 68 transitive deps from my server. :)
- https://npmgraph.js.org/?q=express
- https://npmgraph.js.org/?q=hono