-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Bad practice recommended with Hono + Pages #16446
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
Comments
@yusukebe what's the best way to serve static assets using Hono and Workers Assets? |
I recommend the
name = "my-worker"
main = "src/index.ts"
compatibility_date = "2024-09-19"
assets = { directory = "public" } We (Hono contributors) also have to update the Hono docs: https://hono.dev/docs/getting-started/cloudflare-workers#serve-static-files |
For Cloudflare Pages, we can use this doc: https://hono.dev/docs/getting-started/cloudflare-pages But there is one problem. This does not use C3 because it does not have a Pages template for Hono; it has only a Workers template. So in the doc, it uses npm create hono@latest my-app |
Updated: honojs/website#505 |
Howdy @ToriLindsay, this looks like we also need to update the current hono page in our docs (listed above) to match the changes implemented in https://github.com/honojs/website/pull/505/files |
Existing documentation URL(s)
https://developers.cloudflare.com/pages/framework-guides/deploy-a-hono-site/
What changes are you suggesting?
This page is encouraging users to use Hono to serve assets. This is bad practice. It'll cause an unnecessary Worker invocation (and therefore potentially additional fees for users), instead of using something like Pages Functions Routing, or
_routes.json
.It's also extremely confusing to end-users why and how Pages is used here.
Additional information
No response
The text was updated successfully, but these errors were encountered: