-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
feat: allow support for a root path #5904
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Jordan! Tejas will appreciate this work for sure.
@@ -44,6 +44,7 @@ const DeleteAccountPage = lazy(() => import("./pages/DeleteAccountPage")); | |||
// const PlaygroundPage = lazy(() => import("./pages/Playground")); | |||
|
|||
const SignUp = lazy(() => import("./pages/SignUpPage")); | |||
const rootPath = process.env.LANGFLOW_ROOT_PATH || ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fixed at build time. We have an endpoint that sends config from the backend to the UI at runtime (api/v1/config
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind explaining this a bit more? I was following the pattern I saw in the vite config - https://github.com/langflow-ai/langflow/blob/support-base-path/src/frontend/vite.config.mts#L43.
Do you mean that we should rather access the value from the backend config? If so, wouldn't that require the BE be up before a FE can come up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that if we always set the env on the backend and pass it through a config endpoint is better than using decentralized env variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Backend serves the Frontend. Also, that variable won't be available at runtime. When the frontend is built it will grab that and fix the value to whatever it was at the build time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ogabrielluiz I talked to @anovazzi1 about this and he believes that this is the correct solution. If we want the frontend to be available at a specific root path, does it not need to be available at build time?
@anovazzi1 can likely explain it better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What this doesn't do is allow a separate root path for the frontend and the backend, but I think that's okay for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using useGetConfig
to get this puts this PR in a good state. I'd advise adding a Docker compose example on how to use/test this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically putting this on getConfig is not really useful, because this change needs to be done before the frontend builds, that way makes sense reading directly from the env instead of making a request
Could be related to this: https://fastapi.tiangolo.com/advanced/behind-a-proxy/#about-root_path Did you use uvicorn (i.e. |
Ah, yes, that must be what this is. That seems like intended behavior - do you see any issue in this then? (And I was running with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
f1b28b2
to
4daf87d
Compare
@@ -44,6 +44,7 @@ const DeleteAccountPage = lazy(() => import("./pages/DeleteAccountPage")); | |||
// const PlaygroundPage = lazy(() => import("./pages/Playground")); | |||
|
|||
const SignUp = lazy(() => import("./pages/SignUpPage")); | |||
const rootPath = process.env.LANGFLOW_ROOT_PATH || ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using useGetConfig
to get this puts this PR in a good state. I'd advise adding a Docker compose example on how to use/test this.
Adds support for adding a root_path, so users can execute on a relative path.