-
Notifications
You must be signed in to change notification settings - Fork 255
[Feat] - Client appliaction routes constructed considering the BASE_URL #969
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
base: dev
Are you sure you want to change the base?
Conversation
👷 Deploy request for lowcoder-cloud pending review.Visit the deploys page to approve it
|
…der to avoid possible "//" when building the rest of the routes
… app. Fixxed the conditional assignation of APP_ROOT
Hello @nachogrj - you will smile, cause in the branch https://github.com/lowcoder-org/lowcoder/tree/feature-sub-path - we tried pretty much exactly this. We need to check the solution for the plugin loader. It could have cross effects. Question... How about we join forces - and wor together in the feature-sub-path about this topic? |
Sure @FalkWolsky, the only thing is that I don't see how these changes may affect the plugin loader since the actual routes for routing requests (and loading files) are handled in the Nginx configuration (I am not familiar with how this backend works). |
Let us ask a small thing... By introducing the BASE_URL - what is the actual goal behind? But this is tricky... Cause BASE_URL would be only used at Build time. Also, static resources are not affected by it. This counts for libraries (js), images and CSS. Is "subpath" the goal of your PR? |
As Falk mentioned, adding BASE_URL into the code is not enough in our case. The code is compiled into static files, so once it is generated, the variable will not help you, because all links in html/css/js will be generated with whatever it was set to during compile time. |
@FalkWolsky Yes, our intention is to publish the app (as a sub-path) using a reverse proxy. @ludomikula yes I'm awared of it, would it be possible to do it by injecting the configuration through an ".env" (when building the Dockerfile or running the docker-compose) file and checking the values from the application using "window.env.BASE_URL" at runtime (or something similar). Does it seem feasible? |
Building the frontend image on startup would take really long time. It's quite a heavy process. What might be doable, is to generate a placeholder in the static files, something like LOWCODER_BASE_URL which then we could rewrite in nginx to the configured value. |
@ludomikula Sorry maybe I didn't express myself correctly, I said building the docker image but I was referring exclusively to its execution (running the container). I was thinking of getting the value of the environment variable at runtime, not at build time. Anyway, the problem we run into is the navigation from the client application, for which, the URLs do not contain the prefix that would allow us to distinguish for which application exactly I have to rewrite the URL (I'm thinking of a reverse proxy in front of multiple applications, not just the lowcoder ecosystem). Maybe the only way is to add a fixed block in the URL to be able to detect that a rewrite is to be performed. Is that what you meant? |
@nachogrj yes, that's what I meant. Currently am not aware of another solution. |
b319e9c
to
7a26dc6
Compare
Proposed changes
We wanted to publish the app through a reverse proxy and changing the configuration variables (both when using the already built docker image or building the code ourselves) wasn't taking effect. We detected that the BASE_URL wasn't being used when defining the rest of the routes, nor for the bundleLoader URL.
Types of changes
What types of changes does your code introduce to Lowcoder?
Put an
x
in the boxes that apply.Checklist
You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help!
This is simply a reminder of what we are going to look for before merging your code.
Put an
x
in the boxes that apply.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc.