-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add root path for Quinoa Web UI #691
Conversation
This adds the quarkus.quinoa.ui-root-path property which is the path for hosting the Web UI. The quarkus.quinoa.ignored-path-prefixes property is always relative to quarkus.quinoa.ui-root-path. The quarkus.http.non-application-root-path is not added to the default ignores if it is not relative to quarkus.http.root-path.
There is one issue with consistencies between the dev-mode and a production build which also existed before my changes. This issue is happening because of how Quarkus server files in export default defineConfig({
plugins: [expressPlugin()],
build: {
rollupOptions: {
input: {
quinoa: resolve(__dirname, 'index.html'),
}
}
},
base: "/ui",
server: {
origin: "/ui"
}
}) I wonder if this is something that could be changed in Quarkus itself or if there is a reason why Quarkus does not serve If this is not something that should be changed in Quarkus then maybe Quinoa could redirect |
Another solution would be to explicitly not host |
I also have a back-port of this feature for Should I open a PR for this branch? |
This comment was marked as outdated.
This comment was marked as outdated.
I resolved your merge conflicts |
@liquidnya definitely backport to the 2.3.x branch please as well! |
@all-contributors add @liquidnya for code, idea |
I've put up a pull request to add @liquidnya! 🎉 |
for (BuiltResourcesBuildItem.BuiltResource resource : uiResources.get().resources()) { | ||
// note how uiRootPath always starts and ends in a slash | ||
// and resource.name() always starts in a slash |
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.
from the comments it means there are two slashes no? :)
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.
Should I change the comment to say resource.name() always starts in a slash, therefore resource.name().substring(1) does not
?
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 changed the comment to and resource.name() always starts in a slash, therfore resource.name().substring(1) never starts in a slash
in commit 083e3f4
This looks very good, I'll give it a go tomorrow before approving |
I will make one more change to the PR: |
@FroMage @geoand @cescoffier any reason why we don't use the index.html when there is no trailing IMO, if the |
This did not work, because the lit example uses |
I agree! |
Ok, then @cescoffier @geoand @FroMage you can ignore it's just a small bug in the new StaticHandler for dev mode then upstream issue created: quarkusio/quarkus#41245 |
@ia3andy I pushed more changes. I changed the debug log to print And I fixed ignored paths:
I added tests to |
@melloware I created the PR #696 for the back-port to |
Describe your changes
This change adds the following new property:
quarkus.quinoa.ui-root-path
This is the path where the Web UI will be hosted and is always relative to
quarkus.http.root-path
.The default value is
/
, which is a non-breaking change.For example setting the property
quarkus.quinoa.ui-root-path=/ui
would serve the Web UI at the path/ui
.The paths in the property
quarkus.quinoa.ignored-path-prefixes
are relative toquarkus.quinoa.ui-root-path
which is a non-braking change because the default ofquarkus.quinoa.ui-root-path
is/
.I added normalization to the ignored paths, so paths like
foo///bar
would now be added as/foo/bar
and this should be good since ignored paths are checked against the normalized request path from vertx.When the property is not set then the automatic values are adjusted.
For example when the following properties are set:
Then
/api/
will be added to the ignored paths automatically.Note how
/q/
is not added to the ignored paths, since it is not a sub-path of/app
and the path/app/api/
was adjusted to/api/
since the ignored paths are relative to the ui-root-path.Bug-Fix:
The changes also contain the following bug fix which was an issue even before these changes:
The
quarkus.http.non-application-root-path
is now added correctly to the ignored paths.This is because
quarkus.http.non-application-root-path
is only relative toquarkus.http.root-path
if the non-application path does not start with a slash (/
), otherwise it will be an absolute path that is not relative toquarkus.http.root-path
.Therefore setting the following properties
no longer add the path
/foo/
to the ignored paths.However if the following properties are set
then
/q/
would be added to the ignored paths (and not/app/q/
).Note that
quarkus.resteasy.path
andquarkus.rest.path
are always relative toquarkus.http.root-path
even if they start with a slash (/
).Fixes Issue
Fixes #302
Check List (Check all the applicable boxes)
I assume the documentation is automatically updated by the
.adoc
files or is there any manual step for updating the documentation for changes in config documentation?