-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Vite 6 + Hono sub app + fixes #50
Conversation
commit: |
Hello, seems like this fixes the build process, but now all the cache-control max-age is set to 0, in the previous version it was set to 3600 |
@abn5x Wow thanks! I think my new dev server regex is too broad and make assets rendered by the vite http server. |
Oh you may mean Cloudflare? Ok that's really strange, I can reproduce only for it (but It was 0 before too, something to configure in wrangler?) |
Cloudflare: You can now set (wrangler) |
Fixes #49 #44 #47
AppLoadContext
in dev (dev server issue)basename
experimental_serve_directly
in wrangler config will now use your Hono server to serve assetshonoOptions
in favor ofapp
option (createHonoServer
)basename
configured,.data
requests against root index not correctly routed remix-run/react-router#12295)Basename and Hono sub apps
Note
By default, the React Router app is mounted at
/
(defaultbasename
value).You may not need to use this option. It's for advanced use cases.
Tip
Check this example to see how to use it.
You can use the
basename
option in your React Router config (react-router.config.ts
) to mount your React Router app on a subpath.It will automatically mount the app on the subpath.
Then, you can use the
app
option increateHonoServer
to pass your "root" Hono app. This will be used to mount the React Router app on thebasename
path.Note
You now have two entry points!
/api
- for your API/app
- for your React Router appCloudflare custom assets serving
You can set Cloudflare
experimental_serve_directly
and delegate assets serving to Hono, like for Node and Bun.Tip
Check https://developers.cloudflare.com/workers/static-assets/binding/#experimental_serve_directly
Tip
Check this example to see how to use it.