Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add hono middleware #12

Closed
pomdtr opened this issue Jun 20, 2024 · 2 comments · Fixed by #13
Closed

add hono middleware #12

pomdtr opened this issue Jun 20, 2024 · 2 comments · Fixed by #13

Comments

@pomdtr
Copy link
Contributor

pomdtr commented Jun 20, 2024

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
Copy link
Owner

NfNitLoop commented Jun 20, 2024

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
Copy link
Contributor Author

pomdtr commented Jun 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants