NfNitLoop / deno-embedder

Dev tools for embedding files into Deno applications
40 stars 4 forks source link

add hono middleware #12

Closed pomdtr closed 4 months ago

pomdtr commented 4 months ago

Hono has replaced oak as the go-to http router for deno.

A middleware would be nice. The built-in static middleware can probably be easily adapted:

https://jsr.io/@hono/hono/4.4.7/src/middleware/serve-static/index.ts

NfNitLoop commented 4 months ago

Hono has replaced oak as the go-to http server for deno.

Huh, I'd heard of Hono, but I didn't realize it'd replaced Oak. Is Oak deprecated?

The current oak middleware ("helper") is a sort of "add-on" to deno-embedder's core functionality, and is relegated to a single helpers/oak.ts file. It should be simple to add & export something like that for Hono.

But, since I'm not (yet) a Hono user myself, this might not be my top priority. But I'd welcome a PR!

pomdtr commented 4 months ago

Nope, it's just an alternative.

It just plays really well with the Deno.serve api, and the new deno serve command.

It's also a lot more popular these days. I get a single page of matches if I search for oak in val.town, vs 28 for hono