Open BarryThePenguin opened 1 week ago
Where did you import the HTMLRewriter
?
I think you can create reference to their website. Since HTMLRewriter was a Cloudflare utility
Adding this to Hono would cause confusion from people who does not use Hono.
Hi @BarryThePenguin
Looks good! I'd like you to work on this.
Regarding next
, I think the following is better.
const response = await next()
Cloudflare Pages has it's own concept for middleware functions https://developers.cloudflare.com/pages/functions/middleware/
hono/cloudflare-pages
currently provides ahandle
adapter to use hono with Pages Function, and aserveStatic
adapter to handle static assets. It would be great if there was a similar adapter for Pages middleware.My specific use-case is using
HTMLRewriter
to rewrite static assets based on the value of a cookie.Let me know if this is worth adding, I'd be happy to contribute