-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 root path to run the app on /path
#14972
feat: allow root path to run the app on /path
#14972
Conversation
…i-hsr/lightning into pritam/add-path-prefix
/path
Can this be updated in the docs? |
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.
Some minor nits and clarification on the docs
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.
LGTM!
@pritamsoni-hsr Do you think it would make sense to extract those metadata directly into a private file under a .lightning
folder?
let's leave it s separate feature :) |
"""Start the process that serves the UI at the given hostname and port number. | ||
|
||
Arguments: | ||
host: The hostname where the UI will be served. This gets determined by the dispatcher (e.g., cloud), | ||
but defaults to localhost when running locally. | ||
port: The port number where the UI will be served. This gets determined by the dispatcher, which by default | ||
chooses any free port when running locally. | ||
|
||
root_path: root_path for the server if app in exposed via a proxy at `/<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.
root_path: root_path for the server if app in exposed via a proxy at `/<root_path>` | |
root_path: root_path for the server if app in exposed via a proxy at `/<root_path>` | |
You need to leave an empty line
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.
Can we include an example like https://domain.com/<root_path>/my_page
to visualize what it means.
Co-authored-by: Adrian Wälchli <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@tchaton we could, but I think maintaining it in the app is easiest, we can later serialize and deserialize |
* feat: add base path * uvicorn fix arg * Add prefix * update with base_path fix * replace base path with root path * Apply suggestions from code review Co-authored-by: Kaushik B <[email protected]> Co-authored-by: Kaushik B <[email protected]> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> (cherry picked from commit 8008055)
* feat: add base path * uvicorn fix arg * Add prefix * update with base_path fix * replace base path with root path * Apply suggestions from code review Co-authored-by: Kaushik B <[email protected]> Co-authored-by: Kaushik B <[email protected]> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> (cherry picked from commit 8008055)
* feat: add base path * uvicorn fix arg * Add prefix * update with base_path fix * replace base path with root path * Apply suggestions from code review Co-authored-by: Kaushik B <[email protected]> Co-authored-by: Kaushik B <[email protected]> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
What does this PR do?
allow apps to be served from a custom path when running app behind a proxy.
by default apps are served from
https://<app_id>.litng-ai-03.litng.ai
, this PR adds a feature so apps can be served from 'https://mydomain.com/<my_app>'.if you want to build custom UI, make sure all internal links are prefixed with
window.app_prefix
api_id.litng-ai-03.litng.ai/<custom_path>
and this is because of uvicorn's root path param.Limitations
relative links inside the app will break, so user should use
window.app_prefix
in their JS, there is no warning around that atm.breaking changes
none
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃