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
Serve index.html #232
Comments
Good questions. Some thoughts:
It's almost the same system for the serverless app (
Not a fan of both solutions. Can we assume an URL only resolves to the following?
The goals with serving assets based on their path and name were the following:
Looking at CF Workers and Deno Deploy, they both have a way to read assets (via KV or an FS API). This approach would add more overhead to the serverless app and latency for requests fetching assets, which I'm not a big fan of. |
This doesn't resolve Here's how it's handled on some deployment systems and static servers (for inspiration):
|
True, but I believe it should work if we also add a new check for
These checks match the default behavior of Netlify/Vercel/PHP... |
⛵️ This latest proposal would make Rakkas's prerendering work. To the best of my knowledge, ditto for Next.js and SvelteKit. |
Released in |
It works! Only two small problems remaining in Rakkas CI (I will report/fix soon) :) |
Many frameworks (like Rakkas or Next.js) serve prerendered HTML files without an extension. For example the URL path
/foo
can refer to/foo.html
or/foo/index.html
but Lagon CLI serves static assets only when the URL path is an exact match which breaks static prerendering in Rakkas, and likely will have the same effect on other frameworks.I implemented a simple environment variable based solution in
dev.rs
like this:and it works for the
dev
CLI command.But I don't know the details of the actual deployment environments so I don't know what to do to make it work there. In any case, I feel like this should be a bundler option, not an environment variable, because it's a property of the bundled assets, not of the environment.
Alternatively, I could duplicate the assets in the bundling phase but that seems wasteful.
Yet another alternative could be to let JS handler worry about it and call something like
Lagon.serverAsset(filename)
when it deems appropriate.So I don't know what the exact solution should be but I can volunteer for implementing it if within my abilities.
The text was updated successfully, but these errors were encountered: