Replies: 9 comments
-
|
Perhaps using the config https://vite.dev/config/server-options.html#server-origin is a possibility? |
Beta Was this translation helpful? Give feedback.
-
|
That won't work. The link you posted is for the bite dev server. On the server side, we don't execute JavaScript. This is done at build time. I don't quite follow what your exact redirection scheme is and how it breaks. Could you share more details on what your scheme is? |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your quick reply. My scheme is the following:
Is it clearer? As a workaround, is it possible to deploy a Martin docker image just to deploy the web ui and to connect to my real Martin instance? |
Beta Was this translation helpful? Give feedback.
-
|
On https://aquarepere.banquedesterritoires.fr/territoire/64df477b-cd4e-45b0-b57d-408484726748/Ain/decouvrir, you can find an example with calls to Martin Tile Server. |
Beta Was this translation helpful? Give feedback.
-
|
Martin already uses URL rewrites provided by proxies -- this way generated tilejson uses the correct externally visible URL rather than the internal one. Perhaps it is not implemented for the UI? See also
|
Beta Was this translation helpful? Give feedback.
-
|
Indeed it is not implemented I think. https://vite.dev/guide/build.html#public-base-path could be a solution maybe. |
Beta Was this translation helpful? Give feedback.
-
|
Could you clarify - does Martin generate incorrect URLs as part of the served javascript or other data sent from the server, or does Javascript incorrectly generates link URLs? |
Beta Was this translation helpful? Give feedback.
-
|
Your solution does not work as we don't execute JavaScript on the server. Given that all URLs that the frontend expects are relative to where we are served instead of absolute, this should not be nessesary though. If you just serve from your /martin prefix and your fastapi step removes the prefix, that works. |
Beta Was this translation helpful? Give feedback.
-
|
I moved the issue to a discussion as it is not clear what is the issue |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there,
We would like to use the new web UI on our Martin instance but we don't manage to have it working correctly.
Our Martin instance is hosted on a Kubernetes cluster which uses Traefik for ingress. The main enter point for our setup points to a backend written with FastAPI which also routes requests to other components, including Martin.
A request to the root of the martin server reaches martin but the returned HTML contains links to assets which are relative to the root of martin but not to the URL exposed to the end users.
The URL looks like https://mywonderfuldomain/api/martin/, which is intercepted by our FastAPI backend which then do another request to martin inside our cluster.
I hope this is clear enough.
Beta Was this translation helpful? Give feedback.
All reactions