-
Notifications
You must be signed in to change notification settings - Fork 90
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
Path prefixing #48
Comments
A problem with this fix is that the base url is hardcoded into the binary which makes it less flexible. Instead, consider using something like the following (from Sycamore's router): This extracts the base url from a html |
Yeah I agree, I was ruminating over the inconvenience of it yesterday. Yours however is a far better solution, so I think I'll use that! Thanks for the tip! |
Unfortunately, that's actually not going to work because of the SSR issues. We inline some critical JS that calls the Wasm, which needs to know the base path, and we can't reliably parse that without parsing the entire HTML shell, which will incur a major performance issue. Also, there are issues as to running code that uses the base path in templates, because they might be rendered on the server or the client. It might well be feasible to use an environment variable though, because that would be far more flexible. |
Okay, I've decided to go for a joint approach that's about as flexible as I think I can get it without major re-architecturing. You set a @lukechu10, when I use |
No that is not intentional. Make sure you are using |
Hmm, I observed the same behavior with |
Sometimes I do not understand the web. Setting the base
Documented here. Given that, I'll use the environment variable on the server and then the |
Is your feature request related to a problem? Please describe.
Having built the new Perseus website ready for GitHub Pages, I've realized that it's actually currently impossible to deploy because Perseus assumes everything is at the root of the site, when in fact it may be under something else (like
/perseus/...
for a Pages site).Describe the solution you'd like
Perseus should support a new optional parameter to
define_app!
calledprefix
that allows it to support being hosted underneath an existing URL. This would then be a simple matter of prepending this prefix to every call to.perseus/
that the app shell makes. This particularly affects exported sites.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: