In svelte how to prefix paths for requests (dynamically) #16112
Unanswered
SpiderUnderUrBed
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So all of my routes are nested under /gameserver-rs, so requests will look like http://localhost:8080/gameserver-rs/index.html
I figured out a solution in my html code where I replace a meta tag with the base path, its important its not statically set and the server sets it, however svelte makes requests like:
GET
http://localhost:8080/_app/immutable/chunks/CNE7uOga.js
without gameserver-rs before app, so it fails with 404
IT NEEDS TO BE SET DYNAMICALLY. The server tells the client code where the base path is, I would perfer to not configure such a thing in a proxy, also paths or https://svelte.dev/docs/kit/$app-paths#base I dont think will work, because thats not dynamic, it'll statically set it.
(the reason why it needs to be dynamic is that this is supposed to be a self-hostable app, and with some proxies you would need to set a base path (e.g 192.168.68.77//))
Beta Was this translation helpful? Give feedback.
All reactions